From d1f2e0da1bb8d7e1c4752b319a1698b6f06af3ee Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 18 Dec 2016 09:25:58 -0500 Subject: project: clbuild-bat: added proper version.tag support. --- project/clbuild.sh | 22 +++++++++++++++++++--- 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 -- cgit v1.2.3