summaryrefslogtreecommitdiffhomepage
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rwxr-xr-xproject/clbuild.sh22
-rw-r--r--project/extras.mk14
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 d0bacca..ee3e70f 100644
--- a/project/extras.mk
+++ b/project/extras.mk
@@ -17,9 +17,11 @@ ifeq ($(OS_BINFMT),PE)
endif
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=dalist_version.h \
+ --version-macro=DALIST_GIT_VERSION