File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1+ Makefile export-subst
Original file line number Diff line number Diff line change 2626
2727# Always run the version check script.
2828VERSTRING := $(shell sh version.sh bfi.version.h)
29+ GITARCHVERSION=$Format:%nGITHASH=-DGITHASH=%h%nGITTIME=-DGITTIME="%cd"%nGITDECO ="%d"$
30+ ifneq ($(GITDECO ) ,)
31+ GITTAG=-DGITTAG =$(GITDECO )
32+ endif
2933
3034all : bfi
3135
@@ -84,10 +88,12 @@ install: bfi
8488bfi.gnulit.o : bfi.gnulit.c bfi.tree.h bfi.gnulit.h bfi.run.h
8589 $(CC ) $(CFLAGS ) $(CPPFLAGS ) $(TARGET_ARCH ) -c -o $@ -fno-strict-aliasing -Wno-unused-value bfi.gnulit.c
8690
91+ bfi.version.o : bfi.version.h
92+ $(CC ) $(CFLAGS ) $(CPPFLAGS ) $(TARGET_ARCH ) -c -o $@ $(GITHASH ) $(GITTIME ) $(GITTAG ) bfi.version.c
93+
8794bfi.o : \
8895 bfi.c bfi.tree.h bfi.run.h bfi.be.def bfi.ccode.h bfi.gnulit.h \
8996 bfi.nasm.h bfi.bf.h bfi.dc.h clock.h
90- bfi.version.o : bfi.version.h
9197bfi.bf.o : bfi.bf.c bfi.tree.h
9298bfi.ccode.o : bfi.ccode.c bfi.tree.h bfi.run.h bfi.ccode.h
9399bfi.dc.o : bfi.dc.c bfi.tree.h bfi.run.h
Original file line number Diff line number Diff line change 66#define VS_Q (x ) #x
77#define VS_S (x ) VS_Q(x)
88#define VS (x ) VS_S(VERSION_ ## x)
9+ #ifdef GITHASH
10+ #ifdef GITTAG
11+ #define VERSION VS(MAJOR) "." VS(MINOR) " " \
12+ VS_S(GITHASH) " " VS_S(GITTAG) " " VS_S(GITTIME)
13+ #else
14+ #define VERSION VS(MAJOR) "." VS(MINOR) "." VS(BUILD) "? " \
15+ VS_S(GITHASH) " " VS_S(GITTIME)
16+ #endif
17+ #else
918#define VERSION VS(MAJOR) "." VS(MINOR) "." VS(BUILD) VERSION_SUFFIX
19+ #endif
1020
1121#if defined(__x86_64__ ) || defined(__amd64__ ) || defined(_M_AMD64 )
1222#define PROCESSOR " x64"
Original file line number Diff line number Diff line change 22[ -n " $2 " ] && cd $2
33
44MAJOR=1
5- MINOR=0
5+ MINOR=1
66SUFFIX=" # Unknown @ ` date -R 2> /dev/null || date` "
77BUILD=
88
You can’t perform that action at this time.
0 commit comments