Skip to content

Commit 656e80b

Browse files
committed
Tag version commits and override CONTIKI_VERSION_STRING with git describe
1 parent 758fc37 commit 656e80b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Makefile.include

+9-1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ vpath %.S $(SOURCEDIRS)
136136

137137
CFLAGS += ${addprefix -I,$(SOURCEDIRS)}
138138

139+
### Check for a git repo and pass version if found
140+
### git.exe in Windows cmd shells may require no stderr redirection
141+
#RELSTR=${shell git describe --tags}
142+
RELSTR=${shell git describe --tags 2>/dev/null}
143+
ifneq ($(RELSTR),)
144+
CFLAGS += -DCONTIKI_VERSION_STRING=\"Contiki-$(RELSTR)\"
145+
endif
146+
139147
### Automatic dependency generation
140148

141149
ifneq ($(MAKECMDGOALS),clean)
@@ -152,7 +160,7 @@ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
152160
rm -f $(@:.o=.$$$$)
153161
endef
154162

155-
clean:
163+
clean:
156164
rm -f *~ *core core *.srec \
157165
*.lst *.map \
158166
*.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \

0 commit comments

Comments
 (0)