build: make sure version.c is created before making tools/

This commit is contained in:
Thomas Bernard 2018-11-23 09:57:41 +01:00
parent 259a0b32a9
commit 04848394fb
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
2 changed files with 8 additions and 1 deletions

View File

@ -18,7 +18,7 @@ grafx2:
ziprelease: grafx2
$(OPT)$(MAKE) -C src/ ziprelease
tools:
tools: src/version.c
$(MAKE) -C tools/
3rdparty:
@ -37,3 +37,6 @@ doxygenarchive:
# generate HTML doc to doc/html
htmldoc:
$(MAKE) -C src/ htmldoc
# this C file is generated by the build
src/version.c: grafx2

View File

@ -1,6 +1,10 @@
DOXYGEN = doxygen
TAR = tar
ifneq ($(shell test -f ../src/version.c && echo exists),exists)
$(error please build grafx2 first. missing version.c file.)
endif
GIT_REVISION = $(shell cat ../src/version.c | cut -f 2 -d '"')
LABEL = $(shell cat ../src/pversion.c | cut -f 2 -d '"')
VERSION = $(subst wip.,wip,$(LABEL).$(GIT_REVISION))