Advertisement
delt01

Untitled

Apr 23rd, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. basedir=`dirname $0`
  4. build_timestamp="`date +%Y%m%d_%T | tr ':' '_'`"
  5. build_version=`cat $basedir/../VERSION`
  6. #outfile="timestamp.h"
  7. outfile="timestamp.cpp"
  8.  
  9. #echo "$0: gratuitously wasting 10 seconds of your time..."
  10. #sleep 10
  11.  
  12. # [ -f "$basedir/src/wxwidgets/mainwindow.h" ] || cd ..
  13. # [ -f "$basedir/src/wxwidgets/mainwindow.h" ] || {
  14. #   echo "can't find source directory"
  15. #   exit 1
  16. # }
  17.  
  18. echo "build_timestamp=${build_timestamp}"
  19. build_timestamp_int64="`echo ${build_timestamp} | sed -e 's/://g' -e 's/_//g'`"
  20. echo "build_timestamp_int64=${build_timestamp_int64}"
  21. rm "${outfile}" &>/dev/null # msys2 seems to have problems without this
  22. #echo "#define BUILD_TIMESTAMP ${build_timestamp_int64}" > "${outfile}"
  23. #echo "#define BUILD_VERSION \"${build_version}\"" >> "${outfile}"
  24. echo "/* automatically generated by $0 */" > ${outfile}
  25. echo "#include <stdint.h>" >> ${outfile}
  26. echo "uint64_t g_build_timestamp = ${build_timestamp_int64};" >> ${outfile}
  27. echo "char g_build_version [] = \"${build_version}\";" >> ${outfile}
  28.  
  29. echo
  30. echo "RESULTING OUTPUT FILE:"
  31. echo "________________________________"
  32. echo
  33. cat ${outfile}
  34. echo "________________________________"
  35. echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement