summaryrefslogtreecommitdiff
path: root/solenv/gbuild/LinkTarget.mk
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-07-14 22:29:39 +0200
committerMichael Stahl <mstahl@redhat.com>2013-07-16 15:11:19 +0200
commit4780d94d6d52ff68c72a81bf3e00dbe850995c8c (patch)
tree7ae25d01603306d4980311bbd6360b0afb2b388f /solenv/gbuild/LinkTarget.mk
parent3bfe3bfca27dcc4cb00a85c2b30a5a50f5bad689 (diff)
gbuild: update included dep-targets as side effect of targets
Make builds in 2 phases: first it ensures that all targets that are included by the makefiles (i.e. the .d files) are up to date, then it restarts and builds everything else. It would be possible to update the .d files in the same build by simply having dependencies from the dep-targets to the corresponding real targets, but that has undesirable effects (8b5a984d45005d3df1c89eae897d6e04612625d8). For a successful build, the .d files can actually be updated as a side effect of other rules in such a way that they will be up-to-date on the next make invocation, thus the restart can be avoided. This optimization will not always work in case of build failures. Change-Id: I753039ed33f5a84104f35990769eddc83e1d0d7e
Diffstat (limited to 'solenv/gbuild/LinkTarget.mk')
-rw-r--r--solenv/gbuild/LinkTarget.mk24
1 files changed, 15 insertions, 9 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index a5c7132a6e92..3b648060c03d 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -395,13 +395,13 @@ $(call gb_Output_announce,LNK:$(2),$(true),DEP,1)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
- $(foreach object,$(3),$(call gb_CObject_get_dep_target,$(object))) \
- $(foreach object,$(4),$(call gb_CxxObject_get_dep_target,$(object))) \
- $(foreach object,$(5),$(call gb_ObjCObject_get_dep_target,$(object)))\
- $(foreach object,$(6),$(call gb_ObjCxxObject_get_dep_target,$(object)))\
- $(foreach object,$(7),$(call gb_AsmObject_get_dep_target,$(object)))\
- $(foreach object,$(8),$(call gb_GenCObject_get_dep_target,$(object))) \
- $(foreach object,$(9),$(call gb_GenCxxObject_get_dep_target,$(object))) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_dep_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_dep_target,$(object))) \
+ $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_dep_target,$(object)))\
+ $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_dep_target,$(object)))\
+ $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_dep_target,$(object)))\
+ $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_dep_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_dep_target,$(object))) \
) && \
$(call gb_Executable_get_command,concat-deps) $${RESPONSEFILE} > $(1)) && \
rm -f $${RESPONSEFILE}
@@ -431,7 +431,14 @@ endef
$(call gb_LinkTarget_get_target,Library/%.exports) : $(gb_Library_OUTDIRLOCATION)/%
$(if $(wildcard $@),,mkdir -p $(dir $@) && touch $@)
+# This recipe actually also builds the dep-target as a side-effect, which
+# is an optimization to reduce incremental build time.
+# (with exception for concat-dep executable itself which does not exist yet...)
$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY)
+ifeq ($(gb_FULLDEPS),$(true))
+ $(if $(findstring concat-deps,$*),,\
+ $(call gb_LinkTarget__command_dep,$(call gb_LinkTarget_get_dep_target,$*),$*))
+endif
$(if $(filter $*,$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library_get_linktargetname,$(lib)))),\
$(if $(filter $(true),$(call gb_LinkTarget__is_build_lib,$*)),\
$(call gb_LinkTarget__command,$@,$*),\
@@ -442,8 +449,7 @@ $(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%)
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_LinkTarget_get_dep_target,%) : $(call gb_Executable_get_runtime_dependencies,concat-deps)
-
- $(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS),$(OBJCOBJECTS),$(OBJCXXOBJECTS),$(ASMOBJECTS),$(GENCOBJECTS),$(GENCXXOBJECTS))
+ $(call gb_LinkTarget__command_dep,$@,$*)
endif
# Ok, this is some dark voodoo: When declaring a linktarget with