Add GitVersion.h to Makefile

c4fmdemod
phl0 2017-04-12 10:13:44 +02:00
parent 8a245e7313
commit b4bef6e7c3
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
1 changed files with 8 additions and 0 deletions

View File

@ -171,3 +171,11 @@ endif
ifneq ($(wildcard /opt/openocd/bin/openocd),)
/opt/openocd/bin/openocd -f /opt/openocd/share/openocd/scripts/board/stm32f4discovery.cfg -c "program bin/$(BINELF) verify reset exit"
endif
# Export the current git version if the index file exists, else 000...
GitVersion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif