diff options
author | est31 <MTest31@outlook.com> | 2015-07-31 04:51:57 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-07-31 04:51:57 +0200 |
commit | 7217fd32eb8af01d3012a2ed883598c6a9fbf78e (patch) | |
tree | 021a2783abb78f611035f3187ddf68172da8b3b5 /build/android | |
parent | 05fe9ab2d4a4be252adb456b8bc14896939e4eb7 (diff) | |
download | minetest-7217fd32eb8af01d3012a2ed883598c6a9fbf78e.tar.gz minetest-7217fd32eb8af01d3012a2ed883598c6a9fbf78e.tar.bz2 minetest-7217fd32eb8af01d3012a2ed883598c6a9fbf78e.zip |
Fix 0.4.11 githash for android
Also make only one >-redirection, sparing repetition.
Also, use cut instead of awk, which is shorter and should be a bit faster.
Diffstat (limited to 'build/android')
-rw-r--r-- | build/android/Makefile | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/build/android/Makefile b/build/android/Makefile index 295ddf620..0a70c189a 100644 --- a/build/android/Makefile +++ b/build/android/Makefile @@ -819,28 +819,26 @@ clean_all : $(RM) -r gen libs obj deps bin Debug and_env $(ROOT)/jni/src/android_version.h : - @echo "#ifndef ANDROID_MT_VERSION_H" \ - >${ROOT}/jni/src/android_version.h; \ - echo "#define ANDROID_MT_VERSION_H" \ - >> ${ROOT}/jni/src/android_version.h; \ - echo "#define VERSION_MAJOR $$(cat ${ROOT}/../../CMakeLists.txt | \ - grep ^set\(VERSION_MAJOR\ | sed 's/)/ /' | awk '{print $$2;}')" \ - >> ${ROOT}/jni/src/android_version.h; \ - echo "#define VERSION_MINOR $$(cat ${ROOT}/../../CMakeLists.txt | \ - grep ^set\(VERSION_MINOR\ | sed 's/)/ /' | awk '{print $$2;}')" \ - >> ${ROOT}/jni/src/android_version.h; \ - echo "#define VERSION_PATCH $$(cat ${ROOT}/../../CMakeLists.txt | \ - grep ^set\(VERSION_PATCH\ | sed 's/)/ /' | awk '{print $$2;}')" \ - >> ${ROOT}/jni/src/android_version.h; \ + @ { \ + echo "#ifndef ANDROID_MT_VERSION_H"; \ + echo "#define ANDROID_MT_VERSION_H"; \ + export CMAKE_FILE=${ROOT}/../../CMakeLists.txt; \ + export VERSION_MAJOR=$$(cat $${CMAKE_FILE} | \ + grep ^set\(VERSION_MAJOR\ | sed 's/)/ /' | cut -f2 -d' '); \ + export VERSION_MINOR=$$(cat $${CMAKE_FILE} | \ + grep ^set\(VERSION_MINOR\ | sed 's/)/ /' | cut -f2 -d' '); \ + export VERSION_PATCH=$$(cat $${CMAKE_FILE} | \ + grep ^set\(VERSION_PATCH\ | sed 's/)/ /' | cut -f2 -d' '); \ + echo "#define VERSION_MAJOR $${VERSION_MAJOR}"; \ + echo "#define VERSION_MINOR $${VERSION_MINOR}"; \ + echo "#define VERSION_PATCH $${VERSION_PATCH}"; \ export GITHASH=$$(git rev-parse --short=8 HEAD); \ - export GITTAG=$$(git describe --abbrev=0 --tags); \ - echo "#define VERSION_GITHASH \"$$GITTAG-$$GITHASH-Android\"" \ - >> ${ROOT}/jni/src/android_version.h; \ + export VERSION_STR="$${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_PATCH}";\ + echo "#define VERSION_GITHASH \"$$VERSION_STR-$$GITHASH-Android\""; \ echo "#define VERSION_STRING STR(VERSION_MAJOR)\".\"STR(VERSION_MINOR)\ - \".\"STR(VERSION_PATCH)" \ - >> ${ROOT}/jni/src/android_version.h; \ - echo "#endif" \ - >> ${ROOT}/jni/src/android_version.h; + \".\"STR(VERSION_PATCH)"; \ + echo "#endif"; \ + } > ${ROOT}/jni/src/android_version.h manifest : @VERS_MAJOR=$$(cat ${ROOT}/../../CMakeLists.txt | \ |