From 0ed190936d9781048b226dd12b46fe4dd058b23d Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 5 Sep 2021 01:18:42 +0200 Subject: [PATCH] Show source version in the makefile logs --- client/Makefile | 1 + common_arm/Makefile.hal | 1 + tools/mkversion.sh | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/client/Makefile b/client/Makefile index a2e41dcd9..2ec91c3ef 100644 --- a/client/Makefile +++ b/client/Makefile @@ -390,6 +390,7 @@ endif ################### $(info ===================================================================) +$(info Version info: $(shell ../tools/mkversion.sh --short 2>/dev/null)) $(info Client platform: $(platform)) ifeq ($(SKIPQT),1) diff --git a/common_arm/Makefile.hal b/common_arm/Makefile.hal index b611afb60..d18615278 100644 --- a/common_arm/Makefile.hal +++ b/common_arm/Makefile.hal @@ -221,6 +221,7 @@ export PLATFORM_DEFS_INFO_STANDALONE export PLATFORM_CHANGED $(info ===================================================================) +$(info Version info: $(shell tools/mkversion.sh --short 2>/dev/null || ../tools/mkversion.sh --short 2>/dev/null)) $(info Platform name: $(PLTNAME)) $(info PLATFORM: $(PLATFORM)) $(info PLATFORM_FPGA: $(PLATFORM_FPGA)) diff --git a/tools/mkversion.sh b/tools/mkversion.sh index 37b135e78..226850bcb 100755 --- a/tools/mkversion.sh +++ b/tools/mkversion.sh @@ -8,6 +8,12 @@ export LC_ALL="C" export LANG="C" +SHORT=false +if [ "$1" = "--short" ]; then + SHORT=true + shift +fi + # if you are making your own fork, change this line to reflect your fork-name fullgitinfo="RRG/Iceman" # GIT status 0 = dirty, 1 = clean , 2 = undecided @@ -40,6 +46,10 @@ else # POSIX way... ctime=${dl_time%.*} fi +if $SHORT; then + echo "$fullgitinfo" + exit 0 +fi # Crop so it fits within 50 characters C string, so max 49 chars # POSIX way