From 9913c1dcb8ab051cba1f36a3bc76435a76cb3fc0 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 22 May 2017 13:44:53 -0400 Subject: [PATCH] =?UTF-8?q?AIX=20and=20OS=20X=20(and=20maybe=20BSD)=20sh?= =?UTF-8?q?=20has=20a=20built-in=20echo=20which=20doesn=E2=80=99t=20suppor?= =?UTF-8?q?t=20the=20-n=20flag=20(OS=20X=20sh=20is=20actually=20bash=20but?= =?UTF-8?q?=20it=20doesn=E2=80=99t=20support=20-n=20based=20on=20compile-t?= =?UTF-8?q?ime=20flags=20and=20the=20POSIXLY=5FCORRECT=20environment=20var?= =?UTF-8?q?iable).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- makefile_include.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index ff89df7..e294d31 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -92,7 +92,7 @@ CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare 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),) CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif