From 7015838f5196532d8f05b95b8f591f32779239e2 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Fri, 2 Dec 2022 08:05:01 +0100 Subject: [PATCH] Use my latest proposed patch for improved -v message. It is simpler and gives a better message, especially when repository has been locally modified: 'tcc version 0.9.27 mob:fef701b 2022-12-02T07:11:55+01:00 locally modified (ARM eabihf Linux)'. Hope it's Ok for maintainers --- Makefile | 12 +++++------- tcc.c | 3 --- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 533d75ed..0456f6aa 100644 --- a/Makefile +++ b/Makefile @@ -241,14 +241,12 @@ $(TCC_FILES) : DEFINES += -DONE_SOURCE=0 $(X)tccpp.o : $(TCCDEFS_H) 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 ' - modified')\"" -endif +FROM_GIT := $(shell git rev-parse >/dev/null 2>&1 && echo yes || echo no) -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')\"" +ifeq ($(FROM_GIT),yes) +GITHASH:=$(shell git rev-parse --abbrev-ref HEAD):$(shell git rev-parse --short HEAD) $(shell git log -1 --pretty='format:%cI') +GITHASH+=$(shell git diff --quiet || echo locally modified) +DEF_GITHASH := -DTCC_GITHASH="\"$(GITHASH)\"" endif ifeq ($(CONFIG_debug),yes) diff --git a/tcc.c b/tcc.c index da460cf3..beef6fbf 100644 --- a/tcc.c +++ b/tcc.c @@ -155,9 +155,6 @@ 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