diff --git a/Makefile.arm9 b/Makefile.arm9 index 8048bd4..f16ef16 100644 --- a/Makefile.arm9 +++ b/Makefile.arm9 @@ -56,14 +56,14 @@ endif ifeq ($(strip $(NO_COMMIT_HASH)),) - DEFINES += -DCOMMIT_HASH="\"-$(shell git rev-parse --short=8 HEAD)\"" + VERSION_STR := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/i') else - DEFINES += -DCOMMIT_HASH=\"\" + VERSION_STR := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-.*//') endif -VERSION_STR := $(shell git describe --tags --match v[0-9]*) -DEFINES += -DVER_MAJOR=$(shell echo $(VERSION_STR) | sed -e 's/v//i' -e 's/\.[0-g-]*//i') -DEFINES += -DVER_MINOR=$(shell echo $(VERSION_STR) | sed -e 's/v[0-9]*\.//i' -e 's/-[0-g-]*//i') +DEFINES += -DVER_STRING=\"$(VERSION_STR)\" +DEFINES += -DVER_MAJOR=$(shell echo "$(VERSION_STR)" | sed 's/v\([0-9]*\)\..*/\1/i') +DEFINES += -DVER_MINOR=$(shell echo "$(VERSION_STR)" | sed 's/.*\.\([0-9]*\).*/\1/') .PHONY: clean release diff --git a/source/arm9/menu.c b/source/arm9/menu.c index f6e1018..9489391 100644 --- a/source/arm9/menu.c +++ b/source/arm9/menu.c @@ -64,7 +64,7 @@ consoleSelect(&con_top); - uiPrintCenteredInLine(1, "fastboot 3DS v%" PRIu16 ".%" PRIu16 COMMIT_HASH, VER_MAJOR, VER_MINOR); + uiPrintCenteredInLine(1, "fastboot 3DS " VER_STRING); uiPrintTextAt(1, 4, "Model: %s", bootInfo.model); uiPrintTextAt(1, 5, "\x1B[33m%s\e[0m", bootInfo.boot_env);