]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dts/Makefile: simplify dtc invocation
authorStephen Warren <swarren@nvidia.com>
Wed, 24 Jul 2013 17:09:18 +0000 (10:09 -0700)
committerTom Rini <trini@ti.com>
Fri, 2 Aug 2013 22:29:32 +0000 (18:29 -0400)
The invocation of dtc is significantly more complex that it could be,
in order to work around an issue on old versions of dtc, which print
a message to stdout every time they run.

Remove this workaround, on the assumption that people have or will
upgrade to a newer version of dtc. This simplifies the build rule
significantly.

Related, split the invocation of cpp and dtc into separate commands
rather than a pipeline, so that if either fail, it is detected. This has
the nice benefit of saving off the result of the pre-processing step,
allowing it to be easily inspected.

Assuming a new enough dtc (which an earlier patch enforces), dtc will
parse #line directives in its input file, and generate correct file and
line numbers in error messages, even though cpp is unconditionally
applied to its input file.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
.gitignore
dts/Makefile

index 771b860ee8ef86f50e66b9e16c9c9ede2a2bcba2..43e957ac0b79a97f52992c2af8c2032b59242cb2 100644 (file)
@@ -16,6 +16,7 @@
 *.patch
 *.bin
 *.cfgtmp
+*.dts.tmp
 
 # Build tree
 /build-*
index 35303f7c5a8fdab0e5391c09d3a2bd9acb232c56..edaa65ebb4299d064e54254da2f2a8ea4480b72e 100644 (file)
@@ -35,13 +35,8 @@ all: $(obj).depend $(LIB)
 DT_BIN := $(obj)dt.dtb
 
 $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
-       rc=$$( \
-               cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \
-               { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \
-                   echo $$? >&3 ; } | \
-                 grep -v '^DTC: dts->dtb  on file' ; \
-               } 3>&1 1>&2 ) ; \
-       exit $$rc
+       $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp
+       $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
 
 process_lds = \
        $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'