From 656e80b57a01e17e18362c582737040d72d2116d Mon Sep 17 00:00:00 2001 From: David Kopf Date: Sat, 16 Jul 2011 08:53:44 -0400 Subject: [PATCH] Tag version commits and override CONTIKI_VERSION_STRING with git describe --- Makefile.include | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index 89dd09304..8ed358203 100644 --- a/Makefile.include +++ b/Makefile.include @@ -136,6 +136,14 @@ vpath %.S $(SOURCEDIRS) CFLAGS += ${addprefix -I,$(SOURCEDIRS)} +### Check for a git repo and pass version if found +### git.exe in Windows cmd shells may require no stderr redirection +#RELSTR=${shell git describe --tags} +RELSTR=${shell git describe --tags 2>/dev/null} +ifneq ($(RELSTR),) +CFLAGS += -DCONTIKI_VERSION_STRING=\"Contiki-$(RELSTR)\" +endif + ### Automatic dependency generation ifneq ($(MAKECMDGOALS),clean) @@ -152,7 +160,7 @@ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ rm -f $(@:.o=.$$$$) endef -clean: + clean: rm -f *~ *core core *.srec \ *.lst *.map \ *.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \