Fix building without git available (#554)

The current code requires git even if there is not .git directory.
Switch to piping the output of git directly to the version file,
which makes sure that it is not called during if evaluation.

Report and patch thanks to Sebastian Graf (sgraf812)
This commit is contained in:
Norbert Preining 2019-06-23 06:57:40 +09:00 committed by abraunegg
parent d939d38c4f
commit 7588774efb

View file

@ -141,7 +141,7 @@ endif
version:
if [ -f .git/HEAD ] ; then \
echo $(shell git describe --tags) > version ; \
git describe --tags > version ; \
else \
echo $(version) > version ; \
fi