From 61a86b7f062c54b4c166fdef8abc2bcae9564ce0 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 12 Apr 2017 11:12:50 +0200 Subject: [PATCH] Make GITVERSION a macro and make before nucleo --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cc6b4ee..8c93c7a 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,7 @@ pi: CXXFLAGS+=$(DEFS_PI) -Os -fno-exceptions -ffunction-sections -fdata-sections pi: LDFLAGS+=-Os --specs=nano.specs pi: release +nucleo: GitVersion.h nucleo: CFLAGS+=$(DEFS_NUCLEO) -Os -ffunction-sections -fdata-sections -fno-builtin -Wno-implicit -DCUSTOM_NEW -DNO_EXCEPTIONS nucleo: CXXFLAGS+=$(DEFS_NUCLEO) -Os -fno-exceptions -ffunction-sections -fdata-sections -fno-builtin -fno-rtti -DCUSTOM_NEW -DNO_EXCEPTIONS nucleo: LDFLAGS+=-Os --specs=nano.specs @@ -175,7 +176,7 @@ endif # Export the current git version if the index file exists, else 000... GitVersion.h: ifneq ("$(wildcard .git/index)","") - echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ + echo "#define GITVERSION \"$(shell git rev-parse --short HEAD)\"" > $@ else - echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ + echo "#define GITVERSION \"0000000\"" > $@ endif