aboutsummaryrefslogtreecommitdiff
path: root/make_helpers
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@st.com>2018-09-04 10:44:00 +0200
committerYann Gautier <yann.gautier@st.com>2018-09-28 15:28:53 +0200
commit077b3e9afc92927d9f81a188c244737435fe3189 (patch)
tree82ffe9ff7bdedca4b4131a4e016a75591ad17a60 /make_helpers
parent07a2fd6af6a74df278be9d4b757e4ad037fd1687 (diff)
downloadtrusted-firmware-a-077b3e9afc92927d9f81a188c244737435fe3189.tar.gz
MAKE_DTB: dependencies on device tree source files
Fixes the dependencies issue for DTB image build. Use -MT $(DTBS) -MMD -MF $(DTSDEP) to generate the precompilation dependencies on DTS file(s). "-MT $(DTBS)" builds a dependency for the target DTS file. "-MMD" includes header file dependencies but not on system header files. "-MF $(DTSDEP)" generates a Makefile script to define the dependencies which is included afterward. This change renames existing variable DEP into DTBDEP. Signed-off-by: Yann Gautier <yann.gautier@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
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 92a0f6e86e..44c537b4c6 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -450,17 +450,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