core: Add version string

This commit is contained in:
tmk 2021-07-16 11:34:00 +09:00
parent eb3d3b4c29
commit 86b4d082d9
4 changed files with 14 additions and 2 deletions

View file

@ -113,7 +113,7 @@ ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE)))
endif
# Version string
TMK_VERSION := $(shell (git describe --always --dirty=+ || echo 'unknown') 2> /dev/null)
TMK_VERSION := $(shell (git rev-parse --short=6 HEAD || echo 'unknown') 2> /dev/null)
OPT_DEFS += -DTMK_VERSION=$(TMK_VERSION)

View file

@ -4,6 +4,10 @@ TMK_LUFA_DIR = protocol/lufa
TMK_LUFA_PATH ?= $(TMK_LUFA_DIR)/lufa-abcminiuser
# Version string
TMK_LUFA_VERSION := $(shell (cd $(TMK_DIR)/$(TMK_LUFA_PATH); git rev-parse --short=6 HEAD || echo 'unknown') 2> /dev/null)
OPT_DEFS += -DTMK_LUFA_VERSION=$(TMK_LUFA_VERSION)
# Create the LUFA source path variables by including the LUFA makefile
ifneq (, $(wildcard $(TMK_DIR)/$(TMK_LUFA_PATH)/LUFA/Build/LUFA/lufa-sources.mk))
LUFA_PATH = $(TMK_LUFA_PATH)/LUFA

View file

@ -708,7 +708,11 @@ int main(void)
print_set_sendchar(sendchar);
host_set_driver(&lufa_driver);
print("\n\nTMK:" STR(TMK_VERSION) "/LUFA\n\n");
print("\nTMK:" STR(TMK_VERSION) "/LUFA:" STR(TMK_LUFA_VERSION)
#ifdef TMK_USB_HOST_SHIELD_VERSION
"/UHS2:" STR(TMK_USB_HOST_SHIELD_VERSION)
#endif
"\n");
hook_early_init();
keyboard_setup();
setup_usb();

View file

@ -12,6 +12,10 @@ USB_HOST_SHIELD_SRC = \
$(USB_HOST_SHIELD_DIR)/parsetools.cpp \
$(USB_HOST_SHIELD_DIR)/message.cpp
# Version string
TMK_USB_HOST_SHIELD_VERSION := $(shell (cd $(TMK_DIR)/$(USB_HOST_SHIELD_DIR); git rev-parse --short=6 HEAD || echo 'unknown') 2> /dev/null)
OPT_DEFS += -DTMK_USB_HOST_SHIELD_VERSION=$(TMK_USB_HOST_SHIELD_VERSION)
#