Tag version commits and override CONTIKI_VERSION_STRING with git describe

This commit is contained in:
David Kopf 2011-07-16 08:53:44 -04:00
parent 758fc37307
commit 656e80b57a

View File

@ -136,6 +136,14 @@ vpath %.S $(SOURCEDIRS)
CFLAGS += ${addprefix -I,$(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 ### Automatic dependency generation
ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),clean)
@ -152,7 +160,7 @@ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
rm -f $(@:.o=.$$$$) rm -f $(@:.o=.$$$$)
endef endef
clean: clean:
rm -f *~ *core core *.srec \ rm -f *~ *core core *.srec \
*.lst *.map \ *.lst *.map \
*.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \ *.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \