]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp-test-sw/Makefile.version
Update rpp-lib
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / Makefile.version
1 ifeq ($(OS),Windows_NT)
2 GIT=C:\\Program Files (x86)\\Git\\bin\\git.exe
3 ifeq ($(shell $(GIT) version),)
4 GIT=C:\\Program Files\\Git\\bin\\git.exe
5 ifeq ($(shell $(GIT) version),)
6 GIT=git.exe
7 endif
8 endif
9 else # UNIX
10 GIT=git
11 endif
12
13 VERSION:=$(shell "$(GIT)" describe)
14 VERSION:=$(if $(VERSION),$(VERSION),unknown)
15
16 ifneq ($(VERSION),unknown)
17 # Always update version.h if we are in a git repo. Otherwise create
18 # the file only if it does not exist.
19 .PHONY: version.h
20 endif
21
22 version.h:
23 ifeq ($(OS),Windows_NT)
24         echo #define GIT_VERSION "$(VERSION)" > $@
25 else
26         echo '#define GIT_VERSION "$(VERSION)"' > $@
27 endif