diff options
author | Christian Hesse <mail@eworm.de> | 2017-11-22 00:28:26 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2017-11-22 00:28:26 +0100 |
commit | 1911bfb08946a88c9c32cefabd6d3469675a1671 (patch) | |
tree | c5efa073aa89696637e681f95eb3f65501460eb0 | |
parent | 8113ffe5a4172b2e352b9a58cb043c103c42cb26 (diff) | |
download | nullshell-1911bfb08946a88c9c32cefabd6d3469675a1671.tar.gz nullshell-1911bfb08946a88c9c32cefabd6d3469675a1671.tar.zst |
use printf to generate version.h
-rw-r--r-- | Makefile | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -23,9 +23,7 @@ nullshell: nullshell.c config.h version.h $(CC) $(CFLAGS) $(LDFLAGS) -o nullshell nullshell.c version.h: $(wildcard .git/HEAD .git/index .git/refs/tags/*) Makefile - echo "#ifndef VERSION" > $@ - echo "#define VERSION \"$(shell git describe --long 2>/dev/null || echo ${VERSION})\"" >> $@ - echo "#endif" >> $@ + printf "#ifndef VERSION\n#define VERSION \"%s\"\n#endif\n" $(shell git describe --long 2>/dev/null || echo ${VERSION}) > $@ config.h: $(CP) config.def.h config.h |