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