1 # Version: MPL 1.1 / GPLv3+ / LGPLv3+
3 # The contents of this file are subject to the Mozilla Public License Version
4 # 1.1 (the "License"); you may not use this file except in compliance with
5 # the License or as specified alternatively below. You may obtain a copy of
6 # the License at http://www.mozilla.org/MPL/
8 # Software distributed under the License is distributed on an "AS IS" basis,
9 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10 # for the specific language governing rights and limitations under the
13 # Major Contributor(s):
14 # Copyright (C) 2011 David Tardon, Red Hat Inc. <dtardon@redhat.com> (initial developer)
16 # All Rights Reserved.
18 # For minor contributions see the git repository.
20 # Alternatively, the contents of this file may be used under the terms of
21 # either the GNU General Public License Version 3 or later (the "GPLv3+"), or
22 # the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
23 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
24 # instead of those above.
26 desktop_Pagein_get_target
= $(WORKDIR
)/Pagein
/desktop
/$(1)
27 desktop_Pagein_get_clean_target
= $(WORKDIR
)/Clean
/Pagein
/desktop
/$(1)
28 desktop_Pagein_get_outdir_target
= $(OUTDIR
)/bin
/pagein-
$(1)
30 desktop_Pagein__istype
= $(findstring $(2),$(call desktop_Pagein__prefix
,$(1)))
31 desktop_Pagein__prefix
= $(firstword $(subst :, ,$(1)))
32 desktop_Pagein__suffix
= $(lastword
$(subst :, ,$(1)))
33 desktop_Pagein__object
= $(call desktop_Pagein__suffix
,$(1))
34 desktop_Pagein__dir
= $(call desktop_Pagein__prefix
,$(1))
35 desktop_Pagein__libname
= $(notdir $(call gb_Library_get_target
,$(call desktop_Pagein__suffix
,$(1))))
36 desktop_Pagein__libpath
= $(call desktop_Pagein__dir
,$(1))/$(call desktop_Pagein__libname
,$(1))
38 desktop_Pagein__make_path
= \
39 $(if
$(call desktop_Pagein__istype
,$(1),OBJ
),\
40 $(call desktop_Pagein__object
,$(1)),\
41 $(if
$(call desktop_Pagein__istype
,$(1),LIB
),\
42 $(call desktop_Pagein__libname
,$(1)),\
43 $(call desktop_Pagein__libpath
,$(1))))
45 define desktop_Pagein__command
46 $(call gb_Output_announce
,$(2),$(true
),PAG
,5)
47 $(call gb_Helper_abbreviate_dirs
,\
48 mkdir
-p
$(dir $(1)) && rm -f
$(1) \
49 $(foreach object
,$(OBJECTS
),&& echo
$(call desktop_Pagein__make_path
,$(object
)) >> $(1)))
53 .PHONY
: $(call desktop_Pagein_get_clean_target
,%)
54 $(call desktop_Pagein_get_clean_target
,%) :
55 $(call gb_Output_announce
,$*,$(false
),PAG
,5)
56 $(call gb_Helper_abbreviate_dirs
,\
57 rm -f
$(call desktop_Pagein_get_target
,$*) $(call desktop_Pagein_get_outdir_target
,$*))
59 $(call desktop_Pagein_get_target
,%) :
60 $(call desktop_Pagein__command
,$@
,$*,$^
)
62 $(call desktop_Pagein_get_outdir_target
,%) : $(call desktop_Pagein_get_target
,%)
63 $(call gb_Deliver_deliver
,$<,$@
)
65 define desktop_Pagein_Pagein
66 $(call desktop_Pagein_get_target
,$(1)) : OBJECTS
:=
67 $$(eval
$$(call gb_Module_register_target
,$(call desktop_Pagein_get_outdir_target
,$(1)),$(call desktop_Pagein_get_clean_target
,$(1))))
68 $(call desktop_Pagein_get_outdir_target
,$(1)) : $(call desktop_Pagein_get_target
,$(1))
72 define desktop_Pagein_add_lib
73 $(call desktop_Pagein_get_target
,$(1)) : OBJECTS
+= LIB
:$(2)
77 define desktop_Pagein_add_lib_with_dir
78 $(call desktop_Pagein_get_target
,$(1)) : OBJECTS
+= $(strip $(3)):$(2)
82 define desktop_Pagein_add_object
83 $(call desktop_Pagein_get_target
,$(1)) : OBJECTS
+= OBJ
:$(2)
87 define desktop_Pagein_add_libs
88 $(foreach lib
,$(2),$(call desktop_Pagein_add_lib
,$(1),$(lib
)))
92 define desktop_Pagein_add_libs_with_dir
93 $(foreach lib
,$(2),$(call desktop_Pagein_add_lib_with_dir
,$(1),$(lib
),$(3)))
97 define desktop_Pagein_add_objects
98 $(foreach object
,$(2),$(call desktop_Pagein_add_object
,$(1),$(object
)))
102 # vim: set ts=4 sw=4 noet: