update include/version.h only when content changes

This commit is contained in:
Jonas Jelten 2022-05-21 16:51:55 +02:00 committed by Rachel Mant
parent 0a0f5a9dd7
commit 8afaedda37
1 changed files with 8 additions and 2 deletions

View File

@ -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 <include/version.h), $(VERSION_HEADER))
@echo " GEN GIT $@"
$(Q)$(file >$@,$(VERSION_HEADER))
endif
-include *.d