mklove
mklove copied to clipboard
git version should be updated in 'make' phase, not only in './configure'
Currently, gitversion variable is only updated when you do './configure'. This could have issues if you do something like:
git pull; make
So the code will contain the sha before the pull.
This stackoverflow answer is, more or less, the behaviour I think 'gitversion' module should have:
http://stackoverflow.com/a/1843783
In fact, it is enough with this Makefile target. Maybe mklove module is overkill?
.PHONY: ... version.c ...
version.c:
@rm -f $@
@echo "const char *git_revision=\"`git describe --abbrev=6 --tags HEAD --always`\";" >> $@