From 01d237cb70f00b4647a9dbef7301801071626b35 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Mon, 18 Jun 2018 16:00:23 +0200 Subject: Build: add cpp build processing for dtb This is an add-on feature that allows processing device tree with external includes. "-Iinclude" is also added to INCLUDES. It allows inclusion of dt-bindings files either in dts files or drivers, as those files will be in include/dt-bindings/. "-i fdts" is added to the DTC command line. As the pre-processed files are in build directory, the DT source directory has to be explicitely included, to manages /include/ directives. fixes arm-software/tf-issues#595 Signed-off-by: Lionel Debieve Signed-off-by: Yann Gautier --- make_helpers/build_macros.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'make_helpers') diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index cac9dfc4..2a6ded49 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -372,11 +372,14 @@ endef define MAKE_DTB $(eval DOBJ := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2)))) +$(eval DPRE := $(addprefix $(1)/,$(patsubst %.dts,%.pre.dts,$(notdir $(2))))) $(eval DEP := $(patsubst %.dtb,%.d,$(DOBJ))) $(DOBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs + @echo " CPP $$<" + $$(Q)$$(CPP) $$(CPPFLAGS) -x assembler-with-cpp -o $(DPRE) $$< @echo " DTC $$<" - $$(Q)$$(DTC) $$(DTC_FLAGS) -d $(DEP) -o $$@ $$< + $$(Q)$$(DTC) $$(DTC_FLAGS) -i fdts -d $(DEP) -o $$@ $(DPRE) -include $(DEP) -- cgit v1.2.3