Sun, 28 Nov 2010 23:05:31 +0000
[makefile] fix SDL config (cflags and liblnk), fix date formats, fix for cflags with slashes
- Fixed SDL configuration pull-in to use $(shell ...) instead of backticks
- Fix date formats, add DATETIME string
- Fix sed bailout when CFLAGS contains slashes (e.g. paths)
Makefile | file | annotate | diff | revisions | |
src/version.h.in | file | annotate | diff | revisions |
1.1 --- a/Makefile Sun Nov 28 22:05:07 2010 +0000 1.2 +++ b/Makefile Sun Nov 28 23:05:31 2010 +0000 1.3 @@ -278,8 +278,8 @@ 1.4 # SDL support 1.5 #### 1.6 ifeq ($(ENABLE_SDL),yes) 1.7 - LIBLNK += `sdl-config --libs` 1.8 - CFLAGS += `sdl-config --cflags` 1.9 + LIBLNK += $(shell sdl-config --libs) 1.10 + CFLAGS += $(shell sdl-config --cflags) 1.11 endif 1.12 1.13 1.14 @@ -322,8 +322,9 @@ 1.15 @echo $(NEWBUILD) > .buildnum 1.16 1.17 versionheader: 1.18 - @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \ 1.19 - -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \ 1.20 + @sed -e 's/@@datetime@@/$(shell LC_ALL=C date +"%a %d-%b-%Y %T %Z")/g' \ 1.21 + -e 's/@@date@@/$(shell LC_ALL=C date +"%a %d-%b-%Y")/g' \ 1.22 + -e 's/@@time@@/$(shell LC_ALL=C date +"%T %Z")/g' \ 1.23 -e 's/@@whoami@@/$(shell whoami)/g' \ 1.24 -e 's/@@hostname@@/$(shell hostname)/g' \ 1.25 -e 's|@@compiler@@|$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -n 1 | sed -e "s;|;/;")|g' \ 1.26 @@ -336,7 +337,7 @@ 1.27 -e 's/@@vcsrev@@/$(VER_VCSREV)/g' \ 1.28 -e 's/@@vcsstr@@/$(VER_VCSSTR)/g' \ 1.29 -e 's/@@fullverstr@@/$(VER_FULLSTR)/g' \ 1.30 - -e 's/@@cflags@@/$(CFLAGS)/g' \ 1.31 + -e 's:@@cflags@@:$(CFLAGS):g' \ 1.32 < src/version.h.in > src/version.h 1.33 1.34 # version.h creation stuff based on code from the Xen makefile 1.35 @@ -357,7 +358,8 @@ 1.36 @echo 'dep/*.d' >> .hgignore 1.37 @echo '*~' >> .hgignore 1.38 @echo '.*.sw?' >> .hgignore 1.39 - @echo '#define VER_COMPILE_DATE "@@date@@"' > src/version.h.in 1.40 + @echo '#define VER_COMPILE_DATETIME "@@datetime@@"' > src/version.h.in 1.41 + @echo '#define VER_COMPILE_DATE "@@date@@"' >> src/version.h.in 1.42 @echo '#define VER_COMPILE_TIME "@@time@@"' >> src/version.h.in 1.43 @echo '#define VER_COMPILE_BY "@@whoami@@"' >> src/version.h.in 1.44 @echo '#define VER_COMPILE_HOST "@@hostname@@"' >> src/version.h.in
2.1 --- a/src/version.h.in Sun Nov 28 22:05:07 2010 +0000 2.2 +++ b/src/version.h.in Sun Nov 28 23:05:31 2010 +0000 2.3 @@ -1,3 +1,4 @@ 2.4 +#define VER_COMPILE_DATETIME "@@datetime@@" 2.5 #define VER_COMPILE_DATE "@@date@@" 2.6 #define VER_COMPILE_TIME "@@time@@" 2.7 #define VER_COMPILE_BY "@@whoami@@" 2.8 @@ -12,5 +13,5 @@ 2.9 #define VER_EXTRA "@@extraver@@" 2.10 #define VER_VCSREV "@@vcsstr@@" 2.11 2.12 -#define VER_FULLSTR "@@fullverstr@@" 2.13 +#define VER_FULLSTR "@@fullverstr@@" 2.14