History

make tcc -v more informative (also add commit date/time) patch from 'Christian Jullien' <eligis@orange.fr>

noneofyourbusiness committed 3 years ago

Commit 4cb99781 parent 62096262 files · +10 −2Browse files

Unified · Split

2 files
  1. Makefile +7 −2
  2. tcc.c +3 −0
Makefile+7−2
@@ -243,7 +243,12 @@ endif · 242 unmodified lines
243 243
244GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo no)244GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo no)
245ifneq ($(GITHASH),no)245ifneq ($(GITHASH),no)
246DEF_GITHASH := -DTCC_GITHASH="\"$(shell git rev-parse --abbrev-ref HEAD):$(GITHASH)$(shell git diff --quiet || echo '-mod')\""246DEF_GITHASH := -DTCC_GITHASH="\"$(shell git rev-parse --abbrev-ref HEAD):$(GITHASH)$(shell git diff --quiet || echo ' - modified')\""
247endif
248
249GITDATE := $(shell git log -1 >/dev/null 2>&1 && git log -1 --pretty='format:%cI' || echo no)
250ifneq ($(GITDATE),no)
251DEF_GITDATE := -DTCC_GITDATE="\"$(shell git log -1 --pretty='format:%cI')\""
247endif252endif
248 253
249ifeq ($(CONFIG_debug),yes)254ifeq ($(CONFIG_debug),yes)
@@ -265,7 +270,7 @@ $(X)%.o : %.c $(LIBTCC_INC) · 15 unmodified lines
265 270
266# additional dependencies271# additional dependencies
267$(X)tcc.o : tcctools.c272$(X)tcc.o : tcctools.c
268$(X)tcc.o : DEFINES += $(DEF_GITHASH)273$(X)tcc.o : DEFINES += $(DEF_GITHASH) $(DEF_GITDATE)
269 274
270# Host Tiny C Compiler275# Host Tiny C Compiler
271tcc$(EXESUF): tcc.o $(LIBTCC)276tcc$(EXESUF): tcc.o $(LIBTCC)
tcc.c+3−0
@@ -155,6 +155,9 @@ static const char version[] = · 154 unmodified lines
155 "tcc version "TCC_VERSION155 "tcc version "TCC_VERSION
156#ifdef TCC_GITHASH156#ifdef TCC_GITHASH
157 " "TCC_GITHASH157 " "TCC_GITHASH
158#endif
159#ifdef TCC_GITDATE
160 " on "TCC_GITDATE
158#endif161#endif
159 " ("162 " ("
160#ifdef TCC_TARGET_I386163#ifdef TCC_TARGET_I386

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t