make tcc -v more informative (also add commit date/time)
patch from 'Christian Jullien' <eligis@orange.fr>
This commit is contained in:
parent
62096265ed
commit
4cb99787a7
2 changed files with 10 additions and 2 deletions
9
Makefile
9
Makefile
|
@ -243,7 +243,12 @@ endif
|
||||||
|
|
||||||
GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo no)
|
GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo no)
|
||||||
ifneq ($(GITHASH),no)
|
ifneq ($(GITHASH),no)
|
||||||
DEF_GITHASH := -DTCC_GITHASH="\"$(shell git rev-parse --abbrev-ref HEAD):$(GITHASH)$(shell git diff --quiet || echo '-mod')\""
|
DEF_GITHASH := -DTCC_GITHASH="\"$(shell git rev-parse --abbrev-ref HEAD):$(GITHASH)$(shell git diff --quiet || echo ' - modified')\""
|
||||||
|
endif
|
||||||
|
|
||||||
|
GITDATE := $(shell git log -1 >/dev/null 2>&1 && git log -1 --pretty='format:%cI' || echo no)
|
||||||
|
ifneq ($(GITDATE),no)
|
||||||
|
DEF_GITDATE := -DTCC_GITDATE="\"$(shell git log -1 --pretty='format:%cI')\""
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_debug),yes)
|
ifeq ($(CONFIG_debug),yes)
|
||||||
|
@ -265,7 +270,7 @@ $(X)%.o : %.c $(LIBTCC_INC)
|
||||||
|
|
||||||
# additional dependencies
|
# additional dependencies
|
||||||
$(X)tcc.o : tcctools.c
|
$(X)tcc.o : tcctools.c
|
||||||
$(X)tcc.o : DEFINES += $(DEF_GITHASH)
|
$(X)tcc.o : DEFINES += $(DEF_GITHASH) $(DEF_GITDATE)
|
||||||
|
|
||||||
# Host Tiny C Compiler
|
# Host Tiny C Compiler
|
||||||
tcc$(EXESUF): tcc.o $(LIBTCC)
|
tcc$(EXESUF): tcc.o $(LIBTCC)
|
||||||
|
|
3
tcc.c
3
tcc.c
|
@ -155,6 +155,9 @@ static const char version[] =
|
||||||
"tcc version "TCC_VERSION
|
"tcc version "TCC_VERSION
|
||||||
#ifdef TCC_GITHASH
|
#ifdef TCC_GITHASH
|
||||||
" "TCC_GITHASH
|
" "TCC_GITHASH
|
||||||
|
#endif
|
||||||
|
#ifdef TCC_GITDATE
|
||||||
|
" on "TCC_GITDATE
|
||||||
#endif
|
#endif
|
||||||
" ("
|
" ("
|
||||||
#ifdef TCC_TARGET_I386
|
#ifdef TCC_TARGET_I386
|
||||||
|
|
Loading…
Reference in a new issue