]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - dts/Makefile
Unified codebase for TX28, TX48, TX51, TX53
[karo-tx-uboot.git] / dts / Makefile
index 914e479fb2aa6a765d09baef84174f04e2404718..67b2997483a31cde90ec1fc0aa991d25e64b5340 100644 (file)
@@ -47,8 +47,8 @@ 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 ; \
+               cat $< | $(CPP) -P -x assembler-with-cpp $(DTS_CPPFLAGS) - | \
+               { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - >&2 ; \
                    echo $$? >&3 ; } | \
                  grep -v '^DTC: dts->dtb  on file' ; \
                } 3>&1 ) ; \
@@ -66,18 +66,17 @@ $(obj)dt.o: $(DT_BIN)
        # We look in the LDSCRIPT first.
        # Then try the linker which should give us the answer.
        # Then check it worked.
-       oformat=`$(call process_lds,cat $(LDSCRIPT),FORMAT)` ;\
-       oarch=`$(call process_lds,cat $(LDSCRIPT),ARCH)` ;\
-       \
-       [ -z $${oformat} ] && \
+       [ -n "$${LDSCRIPT}" ] && oformat=`$(call process_lds,cat $(LDSCRIPT),FORMAT)` &&\
+               oarch=`$(call process_lds,cat $(LDSCRIPT),ARCH)` ;\
+       [ -z "$${oformat}" ] && \
                oformat=`$(call process_lds,$(GET_LDS),FORMAT)` ;\
-       [ -z $${oarch} ] && \
+       [ -z "$${oarch}" ] && \
                oarch=`$(call process_lds,$(GET_LDS),ARCH)` ;\
        \
-       [ -z $${oformat} ] && \
+       [ -z "$${oformat}" ] && \
                echo "Cannot read OUTPUT_FORMAT from lds file $(LDSCRIPT)" && \
                exit 1 || true ;\
-       [ -z $${oarch} ] && \
+       [ -z "$${oarch}" ] && \
                echo "Cannot read OUTPUT_ARCH from lds file $(LDSCRIPT)" && \
                exit 1 || true ;\
        \