mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-25 19:56:30 +00:00
Add some info about git commit when printing the version.
Also modify dependency generation to be a side-effect of compilation. It's still not quite perfect in picking up some changes (in particular just after a commit, no files have changed but the git identification is now different).
This commit is contained in:
21
make-git-info
Executable file
21
make-git-info
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
desc=$(git describe --tags)
|
||||
|
||||
if [ "$desc" = "" ]
|
||||
then
|
||||
echo "#undef GIT_VERSION" > new-git-info.h
|
||||
else
|
||||
auth=$(git log -n 1 "--pretty=format:%an <%ae> %aD")
|
||||
|
||||
echo "#define GIT_VERSION "'"'"$desc"'"' >new-git-info.h
|
||||
echo "#define GIT_AUTHOR_DATE "'"'"$auth"'"' >>new-git-info.h
|
||||
fi
|
||||
|
||||
# move-if-different
|
||||
if diff new-git-info.h git-info.h >/dev/null 2>&1
|
||||
then
|
||||
rm new-git-info.h
|
||||
else
|
||||
mv new-git-info.h git-info.h
|
||||
fi
|
||||
Reference in New Issue
Block a user