Permalink
Browse files

Tag version commits and override CONTIKI_VERSION_STRING with git desc…

…ribe
  • Loading branch information...
1 parent 758fc37 commit 656e80b57a01e17e18362c582737040d72d2116d @dak664 dak664 committed Jul 16, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 Makefile.include
View
@@ -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 \

0 comments on commit 656e80b

Please sign in to comment.