[U-Boot-Users] [PATCH] version_autogenerated.h: use printf rather than echo -n

Some systems are dumb and do not implement the -n flag to echo (like OS X). Convert the Makefile to use printf as this should work everywhere.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- Makefile | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile index ac0a17f..45d43aa 100644 --- a/Makefile +++ b/Makefile @@ -352,11 +352,9 @@ $(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin
$(VERSION_FILE): - @( echo -n "#define U_BOOT_VERSION "U-Boot " ; \ - echo -n "$(U_BOOT_VERSION)" ; \ - echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \ - $(TOPDIR)) ; \ - echo """ ) > $@.tmp + @( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \ + $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion $(TOPDIR)) \ + ) > $@.tmp @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
gdbtools:

On Friday 02 May 2008, Mike Frysinger wrote:
$(VERSION_FILE):
@( echo -n "#define U_BOOT_VERSION \"U-Boot " ; \
echo -n "$(U_BOOT_VERSION)" ; \
echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
$(TOPDIR)) ; \
echo "\"" ) > $@.tmp
@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
$(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion $(TOPDIR)) \
) > $@.tmp
i realized this may break if the setlocalversion generates a space ... but i dont think that's possible ? if it is, then we should quote the $(shell ...) -mike

In message 200805022347.31319.vapier@gentoo.org you wrote:
On Friday 02 May 2008, Mike Frysinger wrote:
$(VERSION_FILE):
@( echo -n "#define U_BOOT_VERSION \"U-Boot " ; \
echo -n "$(U_BOOT_VERSION)" ; \
echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
$(TOPDIR)) ; \
echo "\"" ) > $@.tmp
@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)"> \
$(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion $(TOPDIR)) \
) > $@.tmp
i realized this may break if the setlocalversion generates a space ... but i dont think that's possible ? if it is, then we should quote the $(shell ...)
I added quotes, just to be sure.
Thanks.
Best regards,
Wolfgang Denk

In message 1209779112-24122-1-git-send-email-vapier@gentoo.org you wrote:
Some systems are dumb and do not implement the -n flag to echo (like OS X). Convert the Makefile to use printf as this should work everywhere.
Signed-off-by: Mike Frysinger vapier@gentoo.org
Makefile | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (2)
-
Mike Frysinger
-
Wolfgang Denk