summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-03-31 00:14:30 +0100
committerMichael Stahl <mstahl@redhat.com>2013-04-01 13:01:16 +0200
commit0e22dd203696869c617a8286b65282fdb392c2cc (patch)
treeea1bb1f3f79661c86056dc4451fd8214c15aaf40
parent4f511caf65d081d5d29e148062a7b84eb170db37 (diff)
gbuild: ExternalPackage: fix incremental builds:
The added files must have a rule that touches them in order to be copied in an incremental build. Change-Id: If53efb711b92fa1005298941f21b2dab23e44e6c
-rw-r--r--solenv/gbuild/ExternalPackage.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/solenv/gbuild/ExternalPackage.mk b/solenv/gbuild/ExternalPackage.mk
index 8ebefba127f6..c4fbc9621e96 100644
--- a/solenv/gbuild/ExternalPackage.mk
+++ b/solenv/gbuild/ExternalPackage.mk
@@ -68,12 +68,37 @@ gb_ExternalPackage_UNPACKED_$(1) := $(2)
endef
+# Mark a source file to be used outside of this module
+#
+# This results in the timestamp of the file being updated, so a possible
+# change is recognized properly by other files depending on it.
+#
+# gb_ExternalPackage_mark_generated_file package file
+define gb_ExternalPackage_mark_generated_file
+$(call gb_UnpackedTarball_get_dir,$(gb_ExternalPackage_UNPACKED_$(1)))/$(2) : \
+ $(call gb_ExternalProject_get_target,$(gb_ExternalPackage_PROJECT_$(1)))
+$(if $(suffix $(2)),\
+ $(call gb_UnpackedTarbal__ensure_pattern_rule,$(gb_ExternalPackage_UNPACKED_$(1)),$(suffix $(2))),\
+ $(call gb_UnpackedTarbal__make_file_rule,$(gb_ExternalPackage_UNPACKED_$(1)),$(2)) \
+)
+
+endef
+
+# Mark several source files to be used outside of this module
+#
+# gb_ExternalProject_mark_generated_files package file(s)
+define gb_ExternalPackage_mark_generated_files
+$(foreach file,$(2),$(call gb_ExternalProject_mark_generated_file,$(1),$(file)))
+
+endef
+
# Add a file
#
# See gb_Package_add_file for details.
#
# gb_ExternalPackage_add_file package dest src
define gb_ExternalPackage_add_file
+$(call gb_ExternalPackage_mark_generated_file,$(1),$(3))
$(call gb_Package_add_file,$(1),$(2),$(3))
endef
@@ -84,6 +109,7 @@ endef
#
# gb_ExternalPackage_add_files package destdir file(s)
define gb_ExternalPackage_add_files
+$(call gb_ExternalPackage_mark_generated_files,$(1),$(3))
$(call gb_Package_add_files,$(1),$(2),$(3))
endef
@@ -94,6 +120,7 @@ endef
#
# gb_ExternalPackage_add_files_with_dir package destdir file(s)
define gb_ExternalPackage_add_files_with_dir
+$(call gb_ExternalPackage_mark_generated_files,$(1),$(3))
$(call gb_Package_add_files_with_dir,$(1),$(2),$(3))
endef
@@ -146,6 +173,8 @@ endef
# gb_ExternalPackage_use_external_project package external
define gb_ExternalPackage_use_external_project
$(call gb_Package_use_external_project,$(1),$(2))
+$(if $(gb_ExternalPackage_PROJECT_$(1)),$(call gb_Output_error,gb_ExternalPackage_use_external_project: only one project allowed))
+gb_ExternalPackage_PROJECT_$(1) := $(2)
endef