From cdcec22e609688812bf0f5ac303cc9c6970efb23 Mon Sep 17 00:00:00 2001 From: ReFil <31960031+ReFil@users.noreply.github.com> Date: Thu, 16 Nov 2023 07:49:39 +0000 Subject: Version compiled FW with automatic macro (#267) * Version compiled FW with hash Auto generates a macro to type out version info, local and github compilation now includes commit hash and timestamp in final uf2 files * Fix local builds makefile doesn't like the script returning the macro, directed to null for local builds as version.dtsi file accessible --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7e95cb8..e5231eb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ DOCKER := $(shell { command -v podman || command -v docker; }) -TIMESTAMP := $(shell date -u +"%Y%m%d%H%M%S") +TIMESTAMP := $(shell date -u +"%Y%m%d%H%M") +COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null) detected_OS := $(shell uname) # Classify UNIX OS ifeq ($(strip $(detected_OS)),Darwin) #We only care if it's OS X SELINUX1 := @@ -12,11 +13,13 @@ endif .PHONY: all clean all: + $(shell bin/get_version.sh >> /dev/null) $(DOCKER) build --tag zmk --file Dockerfile . $(DOCKER) run --rm -it --name zmk \ -v $(PWD)/firmware:/app/firmware$(SELINUX1) \ -v $(PWD)/config:/app/config:ro$(SELINUX2) \ -e TIMESTAMP=$(TIMESTAMP) \ + -e COMMIT=$(COMMIT) \ zmk clean: -- cgit v1.2.3