Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- basedir=`dirname $0`
- build_timestamp="`date +%Y%m%d_%T | tr ':' '_'`"
- build_version=`cat $basedir/../VERSION`
- #outfile="timestamp.h"
- outfile="timestamp.cpp"
- #echo "$0: gratuitously wasting 10 seconds of your time..."
- #sleep 10
- # [ -f "$basedir/src/wxwidgets/mainwindow.h" ] || cd ..
- # [ -f "$basedir/src/wxwidgets/mainwindow.h" ] || {
- # echo "can't find source directory"
- # exit 1
- # }
- echo "build_timestamp=${build_timestamp}"
- build_timestamp_int64="`echo ${build_timestamp} | sed -e 's/://g' -e 's/_//g'`"
- echo "build_timestamp_int64=${build_timestamp_int64}"
- rm "${outfile}" &>/dev/null # msys2 seems to have problems without this
- #echo "#define BUILD_TIMESTAMP ${build_timestamp_int64}" > "${outfile}"
- #echo "#define BUILD_VERSION \"${build_version}\"" >> "${outfile}"
- echo "/* automatically generated by $0 */" > ${outfile}
- echo "#include <stdint.h>" >> ${outfile}
- echo "uint64_t g_build_timestamp = ${build_timestamp_int64};" >> ${outfile}
- echo "char g_build_version [] = \"${build_version}\";" >> ${outfile}
- echo
- echo "RESULTING OUTPUT FILE:"
- echo "________________________________"
- echo
- cat ${outfile}
- echo "________________________________"
- echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement