summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2014-03-21 14:17:51 +0000
committerDan Handley <dan.handley@arm.com>2014-03-26 17:36:36 +0000
commit8d2296f3434c38c1d396ad59bc63062c26d0d547 (patch)
treee3c732d5342d2e957d9b6e736e10f6157e6cbd60 /Makefile
parent0796fe01f8a596d4fad84c228cb5f01117b4029e (diff)
Build system: Trigger dependency checking only for build targets
The Makefile used to specify a blacklist of rules for which dependency checking must not be triggered. This list included cleaning rules only, whereas all other non-build targets (e.g. help, checkpatch, etc.) should also be included. This approach seems a bit fragile because it is easy to forget some non-building rules in the blacklist, as the experience showed us. It is more robust to specify a whitelist of rules for which dependency checking is required. Fixes ARM-software/tf-issues#112 Change-Id: I030c405abb35972a726a5200396430316d18f963
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 3aee9b91..9d02141a 100644
--- a/Makefile
+++ b/Makefile
@@ -231,9 +231,13 @@ define match_goals
$(strip $(foreach goal,$(1),$(filter $(goal),$(MAKECMDGOALS))))
endef
+# List of rules that involve building things
+BUILD_TARGETS := all bl1 bl2 bl31 bl32 fip
-CLEANING := $(call match_goals,clean realclean distclean)
-
+# Does the list of goals specified on the command line include a build target?
+ifneq ($(call match_goals,${BUILD_TARGETS}),)
+IS_ANYTHING_TO_BUILD := 1
+endif
define MAKE_C
@@ -250,7 +254,7 @@ $(PREREQUISITES) : $(2)
@mkdir -p $(1)
$$(Q)$$(CC) $$(CFLAGS) -M -MT $(OBJ) -MF $$@ $$<
-ifeq "$(CLEANING)" ""
+ifdef IS_ANYTHING_TO_BUILD
-include $(PREREQUISITES)
endif
@@ -271,7 +275,7 @@ $(PREREQUISITES) : $(2)
@mkdir -p $(1)
$$(Q)$$(AS) $$(ASFLAGS) -M -MT $(OBJ) -MF $$@ $$<
-ifeq "$(CLEANING)" ""
+ifdef IS_ANYTHING_TO_BUILD
-include $(PREREQUISITES)
endif
@@ -291,7 +295,7 @@ $(PREREQUISITES) : $(2)
@mkdir -p $$(dir $$@)
$$(Q)$$(AS) $$(ASFLAGS) -M -MT $(1) -MF $$@ $$<
-ifeq "$(CLEANING)" ""
+ifdef IS_ANYTHING_TO_BUILD
-include $(PREREQUISITES)
endif