summaryrefslogtreecommitdiff
path: root/make_helpers
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2018-10-04 15:23:09 +0100
committerGitHub <noreply@github.com>2018-10-04 15:23:09 +0100
commit756fac649b31cf2c06c753adf3bebfc9d8644b60 (patch)
tree67e5ba122e465063bc8221cd1e96b64c233eea95 /make_helpers
parent3989a81930c72d19f660262ec7f280b2bbd6f111 (diff)
parent077b3e9afc92927d9f81a188c244737435fe3189 (diff)
Merge pull request #1595 from Yann-lms/dts_dep
MAKE_DTB: dependencies on device tree source files
Diffstat (limited to 'make_helpers')
-rw-r--r--make_helpers/build_macros.mk15
1 files changed, 11 insertions, 4 deletions
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index 520725bb..28ce2a4b 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -451,17 +451,24 @@ endef
# $(2) = input dts
define MAKE_DTB
+# List of DTB file(s) to generate, based on DTS file basename list
$(eval DOBJ := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
+# List of the pre-compiled DTS file(s)
$(eval DPRE := $(addprefix $(1)/,$(patsubst %.dts,%.pre.dts,$(notdir $(2)))))
-$(eval DEP := $(patsubst %.dtb,%.d,$(DOBJ)))
+# Dependencies of the pre-compiled DTS file(s) on its source and included files
+$(eval DTSDEP := $(patsubst %.dtb,%.o.d,$(DOBJ)))
+# Dependencies of the DT compilation on its pre-compiled DTS
+$(eval DTBDEP := $(patsubst %.dtb,%.d,$(DOBJ)))
$(DOBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs
@echo " CPP $$<"
- $$(Q)$$(CPP) $$(CPPFLAGS) -x assembler-with-cpp -o $(DPRE) $$<
+ $(eval DTBS := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
+ $$(Q)$$(CPP) $$(CPPFLAGS) -x assembler-with-cpp -MT $(DTBS) -MMD -MF $(DTSDEP) -o $(DPRE) $$<
@echo " DTC $$<"
- $$(Q)$$(DTC) $$(DTC_FLAGS) -i fdts -d $(DEP) -o $$@ $(DPRE)
+ $$(Q)$$(DTC) $$(DTC_FLAGS) -i fdts -d $(DTBDEP) -o $$@ $(DPRE)
--include $(DEP)
+-include $(DTBDEP)
+-include $(DTSDEP)
endef