diff options
author | midipix <writeonce@midipix.org> | 2016-12-18 09:33:04 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-12-18 09:33:04 -0500 |
commit | 5f5efa0dddb07fc170319eff0efe590eb8e55498 (patch) | |
tree | 431fee70b58b29d2757f718c16db1171cff04208 /project | |
parent | d9b40bf3a77a2b03ea782deec64459706c0b8c31 (diff) | |
download | ntapi-5f5efa0dddb07fc170319eff0efe590eb8e55498.tar.bz2 ntapi-5f5efa0dddb07fc170319eff0efe590eb8e55498.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 a86cec3..bd4ad74 100644 --- a/project/extras.mk +++ b/project/extras.mk @@ -29,9 +29,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=ntapi_version.h \ + --version-macro=NTAPI_GIT_VERSION |