From b729fe3237d9e87bcdbb3aae0b67cb8771c5cb79 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 5 Feb 2024 14:18:14 +0100 Subject: [PATCH] sys/shell: add RIOT_VERSION_EXTRA output This allows to define an extra string that will be output as part of the version command. e.g. an application may define RIOT_VERSION_EXTRA += v1.33.7 RIOT_VERSION_EXTRA += flashed by $(shell whoami --- Makefile.include | 3 +++ sys/shell/cmds/sys.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Makefile.include b/Makefile.include index c88f2baeb8..dc16bc120a 100644 --- a/Makefile.include +++ b/Makefile.include @@ -1072,6 +1072,9 @@ $(RIOTBUILD_CONFIG_HEADER_C).in: FORCE | $(CLEAN) CFLAGS_WITH_MACROS += $(CFLAGS) CFLAGS_WITH_MACROS += -DRIOT_VERSION=\"$(RIOT_VERSION)\" CFLAGS_WITH_MACROS += -DRIOT_VERSION_CODE=$(RIOT_VERSION_CODE) +ifneq (,$(RIOT_VERSION_EXTRA)) + CFLAGS_WITH_MACROS += -DCONFIG_RIOT_VERSION_EXTRA=\""$(RIOT_VERSION_EXTRA)"\" +endif # MODULE_NAME defines. Declared in 'makefiles/modules.inc.mk' CFLAGS_WITH_MACROS += $(EXTDEFINES) diff --git a/sys/shell/cmds/sys.c b/sys/shell/cmds/sys.c index 6c4cb6ce9e..56f323ba66 100644 --- a/sys/shell/cmds/sys.c +++ b/sys/shell/cmds/sys.c @@ -70,6 +70,9 @@ static int _version_handler(int argc, char **argv) printf("%s v%"PRIu32", slot %u\n", RIOT_APPLICATION, hdr->version, slot); } #endif +#ifdef CONFIG_RIOT_VERSION_EXTRA + puts(CONFIG_RIOT_VERSION_EXTRA); +#endif return 0; }