Fix version signature

This commit is contained in:
Armel FAUVEAU
2024-02-05 02:04:23 +01:00
parent 5acc7de23f
commit 0844f74107
2 changed files with 31 additions and 21 deletions

View File

@@ -201,22 +201,32 @@ endif
OBJCOPY = arm-none-eabi-objcopy OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size SIZE = arm-none-eabi-size
AUTHOR_STRING ?= EGZUMER ifeq ($(ENABLE_FEAT_F4HWN),1)
# the user might not have/want git installed AUTHOR_STRING_1 ?= EGZUMER
# can set own version string here (max 7 chars) VERSION_STRING_1 ?= v0.22
ifneq (, $(shell $(WHERE) git))
AUTHOR_STRING_2 ?= F4HWN
VERSION_STRING_2 ?= v1.7
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
VERSION_STRING ?= $(VERSION_STRING_2)
else
AUTHOR_STRING ?= EGZUMER
# the user might not have/want git installed
# can set own version string here (max 7 chars)
ifneq (, $(shell $(WHERE) git))
VERSION_STRING ?= $(shell git describe --tags --exact-match 2>$(NULL_OUTPUT)) VERSION_STRING ?= $(shell git describe --tags --exact-match 2>$(NULL_OUTPUT))
ifeq (, $(VERSION_STRING)) ifeq (, $(VERSION_STRING))
VERSION_STRING := $(shell git rev-parse --short HEAD) VERSION_STRING := $(shell git rev-parse --short HEAD)
endif endif
endif endif
# If there is still no VERSION_STRING we need to make one. # If there is still no VERSION_STRING we need to make one.
# It is needed for the firmware packing script # It is needed for the firmware packing script
ifeq (, $(VERSION_STRING)) ifeq (, $(VERSION_STRING))
VERSION_STRING := NOGIT VERSION_STRING := NOGIT
endif
#VERSION_STRING := 230930b
endif endif
#VERSION_STRING := 230930b
ASFLAGS = -c -mcpu=cortex-m0 ASFLAGS = -c -mcpu=cortex-m0
ifeq ($(ENABLE_OVERLAY),1) ifeq ($(ENABLE_OVERLAY),1)
@@ -380,8 +390,9 @@ ifeq ($(ENABLE_CUSTOM_MENU_LAYOUT),1)
endif endif
ifeq ($(ENABLE_FEAT_F4HWN),1) ifeq ($(ENABLE_FEAT_F4HWN),1)
CFLAGS += -DENABLE_FEAT_F4HWN CFLAGS += -DENABLE_FEAT_F4HWN
FEAT_STRING ?= "F4HWN v1.7" CFLAGS += -DALERT_TOT=10
CFLAGS += -DFEAT_STRING=\"$(FEAT_STRING)\" -DALERT_TOT=10 CFLAGS += -DAUTHOR_STRING_1=\"$(AUTHOR_STRING_1)\" -DVERSION_STRING_1=\"$(VERSION_STRING_1)\"
CFLAGS += -DAUTHOR_STRING_2=\"$(AUTHOR_STRING_2)\" -DVERSION_STRING_2=\"$(VERSION_STRING_2)\"
endif endif
LDFLAGS = LDFLAGS =

View File

@@ -6,11 +6,10 @@
#endif #endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
const char Version[] = AUTHOR_STRING " v0.22"; const char Version[] = AUTHOR_STRING_1 " " VERSION_STRING_1;
const char UART_Version[] = "UV-K5 Firmware, Open Edition, " AUTHOR_STRING "\r\n"; const char Feat[] = "Feat " AUTHOR_STRING_2 " " VERSION_STRING_2;
const char Feat[] = "Feat " FEAT_STRING;
#else #else
const char Version[] = AUTHOR_STRING VER; const char Version[] = AUTHOR_STRING VER;
const char UART_Version[] = "UV-K5 Firmware, Open Edition, " AUTHOR_STRING VER "\r\n";
#endif #endif
const char UART_Version[] = "UV-K5 Firmware, Open Edition, " AUTHOR_STRING VER "\r\n";