diff --git a/Software/codegen/git_rev_macro.py b/Software/codegen/git_rev_macro.py deleted file mode 100644 index 27728af..0000000 --- a/Software/codegen/git_rev_macro.py +++ /dev/null @@ -1,8 +0,0 @@ -import subprocess - -revision = ( - subprocess.check_output(["git", "rev-parse", "--short=10", "HEAD"]) - .strip() - .decode("utf-8") -) -print("-DGIT_REV='\"%s\"'" % revision) \ No newline at end of file diff --git a/Software/codegen/run_pre.py b/Software/codegen/run_pre.py index 283eb05..bfa851e 100644 --- a/Software/codegen/run_pre.py +++ b/Software/codegen/run_pre.py @@ -3,6 +3,12 @@ env.Execute("\"$PYTHONEXE\" -m pip install jinja2") import struct2json import dtcs +from os import popen + +git_revision = popen('git rev-parse --short HEAD').read().strip() + +env.Replace(PROGNAME="firmware_%s.fw" % git_revision) +env.Append(CPPDEFINES=[('GIT_REV', '\\"{}\\"'.format(git_revision))]) struct2json.struct2json() dtcs.build_dtcs() \ No newline at end of file diff --git a/Software/data_src/index.htm b/Software/data_src/index.htm index 785df02..d39e903 100644 --- a/Software/data_src/index.htm +++ b/Software/data_src/index.htm @@ -3,7 +3,7 @@
-