Makefile: use two double-quotations as a pair
[oweals/u-boot.git] / Makefile
index 8b8691350558eeb69ef5c6a35d2eafcb63c5c77b..452d07019283c8a552c08775bcfd60e97a9b9c66 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -187,7 +187,7 @@ ifndef LDSCRIPT
        #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
        ifdef CONFIG_SYS_LDSCRIPT
                # need to strip off double quotes
-               LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
+               LDSCRIPT := $(CONFIG_SYS_LDSCRIPT:"%"=%)
        endif
 endif
 
@@ -345,7 +345,7 @@ ALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.img
 ALL-$(CONFIG_TPL) += $(obj)tpl/u-boot-tpl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
 ifneq ($(CONFIG_SPL_TARGET),)
-ALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET))
+ALL-$(CONFIG_SPL) += $(obj)$(CONFIG_SPL_TARGET:"%"=%)
 endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
@@ -372,7 +372,7 @@ $(obj)u-boot.hex:   $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
 
 $(obj)u-boot.srec:     $(obj)u-boot
-               $(OBJCOPY) -O srec $< $@
+               $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
 
 $(obj)u-boot.bin:      $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
@@ -638,36 +638,33 @@ checkdtc:
 # to regenerate the autoconf.mk file.
 $(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
        @$(XECHO) Generating $@ ; \
-       set -e ; \
        : Generate the dependancies ; \
        $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
-               -MQ $(obj)include/autoconf.mk include/common.h > $@
+               -MQ $(obj)include/autoconf.mk include/common.h > $@ || \
+               rm $@
 
 $(obj)include/autoconf.mk: $(obj)include/config.h
        @$(XECHO) Generating $@ ; \
-       set -e ; \
        : Extract the config macros ; \
-       $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
-               sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
-       mv $@.tmp $@
+       $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
+               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
+       rm $@.tmp
 
 # Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL)
 $(obj)include/tpl-autoconf.mk: $(obj)include/config.h
        @$(XECHO) Generating $@ ; \
-       set -e ; \
        : Extract the config macros ; \
        $(CPP) $(CFLAGS) -DCONFIG_TPL_BUILD  -DCONFIG_SPL_BUILD\
-                       -DDO_DEPS_ONLY -dM include/common.h | \
-       sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
-       mv $@.tmp $@
+                       -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
+               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
+       rm $@.tmp
 
 $(obj)include/spl-autoconf.mk: $(obj)include/config.h
        @$(XECHO) Generating $@ ; \
-       set -e ; \
        : Extract the config macros ; \
-       $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h | \
-       sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
-       mv $@.tmp $@
+       $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
+               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
+       rm $@.tmp
 
 $(obj)include/generated/generic-asm-offsets.h: $(obj)include/autoconf.mk.dep \
        $(obj)include/spl-autoconf.mk \
@@ -797,6 +794,7 @@ clean:
               $(obj)tools/envcrc                                         \
               $(obj)tools/gdb/{astest,gdbcont,gdbsend}                   \
               $(obj)tools/gen_eth_addr    $(obj)tools/img2srec           \
+              $(obj)tools/dump{env,}image                \
               $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk         \
               $(obj)tools/mk{$(BOARD),}spl                               \
               $(obj)tools/mxsboot                                        \
@@ -807,7 +805,6 @@ clean:
               $(obj)board/matrix_vision/*/bootscript.img                 \
               $(obj)board/voiceblue/eeprom                               \
               $(obj)u-boot.lds                                           \
-              $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]          \
               $(obj)arch/blackfin/cpu/init.{lds,elf}
        @rm -f $(obj)include/bmp_logo.h
        @rm -f $(obj)include/bmp_logo_data.h