Merge pull request #1780 from pmanish87/master
authorAntonio Niño Díaz <antonio.ninodiaz@arm.com>
Mon, 28 Jan 2019 12:04:28 +0000 (12:04 +0000)
committerGitHub <noreply@github.com>
Mon, 28 Jan 2019 12:04:28 +0000 (12:04 +0000)
Make device tree pre-processing similar to U-boot/Linux

Makefile
make_helpers/build_macros.mk

index ad1ba152fd9f94707ef63cf30d33f57122ccaefa..4e606a2ca92dd3440cf9627f7a3ba7f83158297f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -242,6 +242,7 @@ TF_LDFLAGS          +=      --gc-sections
 TF_LDFLAGS             +=      $(TF_LDFLAGS_$(ARCH))
 
 DTC_FLAGS              +=      -I dts -O dtb
+DTC_CPPFLAGS           +=      -nostdinc -Iinclude -undef -x assembler-with-cpp
 
 ################################################################################
 # Common sources and include directories
index 961cabfeeea807c331b67dade52b1045c0a9c730..73b84c38a3988f776a474b514db6360db445c06f 100644 (file)
@@ -464,7 +464,7 @@ $(eval DTBDEP := $(patsubst %.dtb,%.d,$(DOBJ)))
 $(DOBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs
        $${ECHO} "  CPP     $$<"
        $(eval DTBS       := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
-       $$(Q)$$(CPP) $$(CPPFLAGS) -x assembler-with-cpp -MT $(DTBS) -MMD -MF $(DTSDEP) -o $(DPRE) $$<
+       $$(Q)$$(PP) $$(DTC_CPPFLAGS) -MT $(DTBS) -MMD -MF $(DTSDEP) -o $(DPRE) $$<
        $${ECHO} "  DTC     $$<"
        $$(Q)$$(DTC) $$(DTC_FLAGS) -i fdts -d $(DTBDEP) -o $$@ $(DPRE)