From 04848394fbde31ce078720d05887dec9338e0e6f Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 23 Nov 2018 09:57:41 +0100 Subject: [PATCH] build: make sure version.c is created before making tools/ --- Makefile | 5 ++++- tools/Makefile | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2ab7bc6c..c092c059 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tools/Makefile b/tools/Makefile index 315eb94a..a80943ad 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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))