Skip to content

Commit b40b25f

Browse files
author
Stephen Warren
committed
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>
1 parent 85f02be commit b40b25f

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

‎scripts/Makefile.lib‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,21 +269,17 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
269269
$(call cmd,dt_S_dtb)
270270

271271
quiet_cmd_dtc = DTC $@
272-
cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
272+
cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
273+
$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
274+
-i $(srctree)/arch/$(SRCARCH)/boot/dts $(DTC_FLAGS) \
275+
-d $(depfile).dtc $(dtc-tmp) ; \
276+
cat $(depfile).pre $(depfile).dtc > $(depfile)
273277

274278
$(obj)/%.dtb: $(src)/%.dts FORCE
275279
$(call if_changed_dep,dtc)
276280

277281
dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
278282

279-
quiet_cmd_dtc_cpp = DTC+CPP $@
280-
cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
281-
$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile).dtc $(dtc-tmp) ; \
282-
cat $(depfile).pre $(depfile).dtc > $(depfile)
283-
284-
$(obj)/%.dtb: $(src)/%.dtsp FORCE
285-
$(call if_changed_dep,dtc_cpp)
286-
287283
# Bzip2
288284
# ---------------------------------------------------------------------------
289285

0 commit comments

Comments
 (0)