diff options
author | midipix <writeonce@midipix.org> | 2016-12-18 09:25:58 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-12-18 09:25:58 -0500 |
commit | d1f2e0da1bb8d7e1c4752b319a1698b6f06af3ee (patch) | |
tree | cceadee28c71750a88ee422004818df5e3a60b83 /project | |
parent | 7ca76bcb82d4b0e00ca4f930b2b76166def9b686 (diff) | |
download | pemagine-d1f2e0da1bb8d7e1c4752b319a1698b6f06af3ee.tar.bz2 pemagine-d1f2e0da1bb8d7e1c4752b319a1698b6f06af3ee.tar.xz |
project: clbuild-bat: added proper version.tag support.
Diffstat (limited to 'project')
-rwxr-xr-x | project/clbuild.sh | 22 | ||||
-rw-r--r-- | project/extras.mk | 14 |
2 files changed, 27 insertions, 9 deletions
diff --git a/project/clbuild.sh b/project/clbuild.sh index cdb2229..bdce227 100755 --- a/project/clbuild.sh +++ b/project/clbuild.sh @@ -11,6 +11,8 @@ mb_ar= mb_source_dir= mb_project_dir= mb_sysroot= +version_header= +version_macro= # one: args for arg ; do @@ -32,6 +34,12 @@ for arg ; do --sysroot=*) mb_sysroot=${arg#*=} ;; + --version-header=*) + version_header=${arg#*=} + ;; + --version-macro=*) + version_macro='-D'${arg#*=}'=\\\"unknown\\\"' + ;; *) error_msg ${arg#}: "unsupported config argument." exit 2 @@ -71,10 +79,19 @@ dirs=`make dirs.tag tree.tag \ -e 's/mkdir -p//g' \ -e 's@/@\\\\@g'` -for d in $dirs; do +for d in build $dirs; do printf 'if not exist %-20smkdir %s\n' "$d" "$d" done +# version.tag +make version.tag > /dev/null + +echo +echo "type nul > build/$version_header" +echo +echo "$cmd_abort_on_error" +echo + echo echo "$cmd_abort_on_error" echo @@ -85,7 +102,6 @@ make shared-objs-asm static-objs-asm \ | grep -v "$mb_project_dir/sysinfo/host" \ | grep -v 'touch dirs.tag' \ | grep -v 'touch host.tag' \ - | grep -v 'touch version.tag' \ | grep -v 'touch app.tag' \ | sed \ -e 's@'"$mb_cc -c "'@ml64 /nologo @' \ @@ -127,7 +143,7 @@ make shared-objs static-objs app-objs \ -e 's@-Wextra @@g' \ -e 's@-Wundef @/Wall @g' \ -e 's@'"$mb_sysroot "'@ @' \ - -e 's,$, -I%sysroot%/include\n\n'"$cmd_abort_on_error"'\n,g' + -e 's,$, '"$version_macro"' -I%sysroot%/include\n\n'"$cmd_abort_on_error"'\n,g' echo echo '@echo.' diff --git a/project/extras.mk b/project/extras.mk index 7216a32..23a71c8 100644 --- a/project/extras.mk +++ b/project/extras.mk @@ -26,9 +26,11 @@ install-headers-custom: install-headers-default $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/bits/nt64 clbuild-bat: - @$(PROJECT_DIR)/project/clbuild.sh \ - --cc=$(CC) \ - --ar=$(AR) \ - --source-dir=$(SOURCE_DIR) \ - --project-dir=$(PROJECT_DIR) \ - --sysroot=$(CFLAGS_SYSROOT) + @$(PROJECT_DIR)/project/clbuild.sh \ + --cc=$(CC) \ + --ar=$(AR) \ + --source-dir=$(SOURCE_DIR) \ + --project-dir=$(PROJECT_DIR) \ + --sysroot=$(CFLAGS_SYSROOT) \ + --version-header=pemagine_version.h \ + --version-macro=PEMAGINE_GIT_VERSION |