1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2 # Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License or as specified alternatively below. You may obtain a copy of
7 # the License at http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
14 # Major Contributor(s):
15 # Copyright (C) 2011 Red Hat, Inc., David Tardon <dtardon@redhat.com>
18 # All Rights Reserved.
20 # For minor contributions see the git repository.
22 # Alternatively, the contents of this file may be used under the terms of
23 # either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 # the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 # instead of those above.
28 gb_Pagein_UREPATH
:= ..
/ure-link
/lib
/
30 gb_Pagein__is_library
= $(filter $(1),$(gb_Library_KNOWNLIBS
))
32 gb_Pagein__get_libdir
= $(if
$(filter URELIB
,$(call gb_Library_get_layer
,$(1))),$(call gb_Pagein_UREPATH
))
34 gb_Pagein__make_library_path
= $(call gb_Pagein__get_libdir
,$(1))$(call gb_Library_get_runtime_filename
,$(1))
36 gb_Pagein__make_path
= \
37 $(if
$(call gb_Pagein__is_library
,$(1)),$(call gb_Pagein__make_library_path
,$(1)),$(1))
39 define gb_Pagein__command
40 $(call gb_Output_announce
,$(2),$(true
),PAG
,5)
41 $(call gb_Helper_abbreviate_dirs
,\
42 mkdir
-p
$(dir $(1)) && rm -f
$(1) \
43 $(foreach object
,$(OBJECTS
),&& echo
$(call gb_Pagein__make_path
,$(object
)) >> $(1)))
47 .PHONY
: $(call gb_Pagein_get_clean_target
,%)
48 $(call gb_Pagein_get_clean_target
,%) :
49 $(call gb_Output_announce
,$*,$(false
),PAG
,5)
50 $(call gb_Helper_abbreviate_dirs
,\
51 rm -f
$(call gb_Pagein_get_target
,$*) $(call gb_Pagein_get_outdir_target
,$*))
53 $(call gb_Pagein_get_target
,%) :
54 $(call gb_Pagein__command
,$@
,$*,$^
)
56 $(call gb_Pagein_get_outdir_target
,%) : $(call gb_Pagein_get_target
,%)
57 $(call gb_Deliver_deliver
,$<,$@
)
59 define gb_Pagein_Pagein
60 $(call gb_Pagein_get_target
,$(1)) : OBJECTS
:=
61 $(call gb_Pagein_get_target
,$(1)) : $(realpath
$(lastword
$(MAKEFILE_LIST
)))
62 $$(eval
$$(call gb_Module_register_target
,$(call gb_Pagein_get_outdir_target
,$(1)),$(call gb_Pagein_get_clean_target
,$(1))))
63 $(call gb_Pagein_get_outdir_target
,$(1)) : $(call gb_Pagein_get_target
,$(1))
67 define gb_Pagein_add_object
68 $(call gb_Pagein_get_target
,$(1)) : OBJECTS
+= $(2)
72 define gb_Pagein_add_objects
73 $(foreach object
,$(2),$(call gb_Pagein_add_object
,$(1),$(object
)))
77 # vim: set ts=4 sw=4 noet: