From 8afaedda37d29e8f10e1cd69f596d52736d12487 Mon Sep 17 00:00:00 2001 From: Jonas Jelten Date: Sat, 21 May 2022 16:51:55 +0200 Subject: [PATCH] update include/version.h only when content changes --- src/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 1eec289..e739bc2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -162,7 +162,13 @@ all_platforms: command.c: include/version.h +GIT_VERSION := $(shell git describe --always --dirty --tags) +VERSION_HEADER := \#define FIRMWARE_VERSION "$(GIT_VERSION)" + include/version.h: FORCE - $(Q)echo " GIT include/version.h" - $(Q)echo "#define FIRMWARE_VERSION \"$(shell git describe --always --dirty --tags)\"" > $@ +ifneq ($(file $@,$(VERSION_HEADER)) +endif + -include *.d