Browse Source

AIX and OS X (and maybe BSD) sh has a built-in echo which doesn’t support the -n flag (OS X sh is actually bash but it doesn’t support -n based on compile-time flags and the POSIXLY_CORRECT environment variable).

AIX /bin/echo doesn’t support -n.

AIX echo and OS X /bin/echo support \c to prevent a trailing newline but linux echo (bash builtin and /bin/echo) don’t support it unless you also use the -e flag (which is not support by AIX /bin/echo or OS X sh or /bin/echo).

The BSD echo man page suggests using printf to avoid trailing newline, which is available on linux, OS X, and AIX.
Kelvin Sherlock 8 years ago
parent
commit
9913c1dcb8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      makefile_include.mk

+ 1 - 1
makefile_include.mk

@@ -92,7 +92,7 @@ CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare
 endif
 endif
 
 
 
 
-GIT_VERSION := $(shell [ -e .git ] && { echo -n git- ; git describe --tags --always --dirty ; } || echo $(VERSION))
+GIT_VERSION := $(shell [ -e .git ] && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION))
 ifneq ($(GIT_VERSION),)
 ifneq ($(GIT_VERSION),)
 CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
 CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
 endif
 endif