summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-05-17 11:28:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-20 15:53:06 +0200
commitc08215ada62942296443e6a7fcfcac95614880c1 (patch)
tree7af59db259a2347f65c92e8e7dddba9808d3df6c /scripts/Makefile.lib
parentc478aa16b1913b7f2771a14721e68e3cae8c4fdf (diff)
downloadbarebox-c08215ada62942296443e6a7fcfcac95614880c1.tar.gz
barebox-c08215ada62942296443e6a7fcfcac95614880c1.tar.xz
kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp
Based on the same Linux commit from Stephen Warren: commit b40b25fff8205dd18124d8fc87b2c9c57f269b5f Author: Stephen Warren <swarren@nvidia.com> Date: Wed Mar 6 10:58:37 2013 -0700 kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp Replace cmd_dtc with cmd_dtc_cpp, and delete the latter. Previously, a special file extension (.dtsp) was required to trigger the C pre-processor to run on device tree files. This was ugly. Now that previous changes have enhanced cmd_dtc_cpp to collect dependency information from both gcc -E and dtc, we can transparently run the pre- processor on all device tree files, irrespective of whether they use /include/ or #include syntax to include *.dtsi. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib21
1 files changed, 9 insertions, 12 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index bbfd4cd2de..c50bb4e8ea 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -141,10 +141,10 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
-dtc_cpp_flags = -Wp,-MD,$(depfile) -nostdinc \
- -I$(srctree)/arch/$(SRCARCH)/dts \
- -I$(srctree)/arch/$(SRCARCH)/include/dts \
- -undef -D__DTS__
+dtc_cpp_flags = -Wp,-MD,$(depfile).pre -nostdinc \
+ -I$(srctree)/arch/$(SRCARCH)/dts \
+ -I$(srctree)/arch/$(SRCARCH)/dts/include \
+ -undef -D__DTS__
# Finds the multi-part object the current object will be linked into
modname-multi = $(sort $(foreach m,$(multi-used),\
@@ -212,20 +212,17 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd,dt_S_dtb)
quiet_cmd_dtc = DTC $@
-cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
+cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+ $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
+ -i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \
+ -d $(depfile).dtc $(dtc-tmp) ; \
+ cat $(depfile).pre $(depfile).dtc > $(depfile)
$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)
dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
-quiet_cmd_dtc_cpp = DTC+CPP $@
-cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp)
-
-$(obj)/%.dtb: $(src)/%.dtsp FORCE
- $(call if_changed_dep,dtc_cpp)
-
# Bzip2
# ---------------------------------------------------------------------------