summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2021-06-27 02:29:02 +1000
committerGitHub <noreply@github.com>2021-06-27 02:29:02 +1000
commitbbe43a91ebf193bbc8c09ba59209b0524367e68c (patch)
treeb4b1cac772b2601154153a39d2173334cdf363d9 /Makefile
parent546f5f2c4f38a4abf934e3df84985feca61f90c7 (diff)
CLI: Add subcommand to generate version.h (#13151)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 6 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index e007ae3679..866bcaaf3f 100644
--- a/Makefile
+++ b/Makefile
@@ -548,29 +548,14 @@ git-submodule:
git submodule sync --recursive
git submodule update --init --recursive --progress
-ifdef SKIP_VERSION
-SKIP_GIT := yes
-endif
-
# Generate the version.h file
-ifndef SKIP_GIT
- GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
- CHIBIOS_VERSION := $(shell cd lib/chibios && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
- CHIBIOS_CONTRIB_VERSION := $(shell cd lib/chibios-contrib && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
-else
- GIT_VERSION := NA
- CHIBIOS_VERSION := NA
- CHIBIOS_CONTRIB_VERSION := NA
+ifdef SKIP_GIT
+VERSION_H_FLAGS := --skip-git
endif
-ifndef SKIP_VERSION
-BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
-else
-BUILD_DATE := 2020-01-01-00:00:00
+ifdef SKIP_VERSION
+VERSION_H_FLAGS := --skip-all
+SKIP_GIT := yes
endif
-
-$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
-$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
-$(shell echo '#define CHIBIOS_VERSION "$(CHIBIOS_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
-$(shell echo '#define CHIBIOS_CONTRIB_VERSION "$(CHIBIOS_CONTRIB_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
+$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o quantum/version.h)
include $(ROOT_DIR)/testlist.mk