Hi, Currently, tcc –v displays the (mob) githash which helps to identify which this version comes from. It is not however user friendly.
I would like to add last commit date as: jullien@sims4:~/tinycc $ ./tcc -v tcc version 0.9.27 mob:afcdaf1 on 2022-11-29T00:56:26-06:00 (ARM eabihf Linux) Maintainers, can you please apply a patch similar to this one? jullien@sims4:~/tinycc $ git diff diff --git a/Makefile b/Makefile index efe0885..6377570 100644 --- a/Makefile +++ b/Makefile @@ -243,7 +243,12 @@ endif GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo 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 ifeq ($(CONFIG_debug),yes) @@ -265,7 +270,7 @@ $(X)%.o : %.c $(LIBTCC_INC) # additional dependencies $(X)tcc.o : tcctools.c -$(X)tcc.o : DEFINES += $(DEF_GITHASH) +$(X)tcc.o : DEFINES += $(DEF_GITHASH) $(DEF_GITDATE) # Host Tiny C Compiler tcc$(EXESUF): tcc.o $(LIBTCC) diff --git a/tcc.c b/tcc.c index beef6fb..da460cf 100644 --- a/tcc.c +++ b/tcc.c @@ -155,6 +155,9 @@ static const char version[] = "tcc version "TCC_VERSION #ifdef TCC_GITHASH " "TCC_GITHASH +#endif +#ifdef TCC_GITDATE + " on "TCC_GITDATE #endif " (" #ifdef TCC_TARGET_I386 _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel