Skip to content

Commit

Permalink
Makefile.include: Assign git description variable once.
Browse files Browse the repository at this point in the history
By changing RELSTR= into RELSTR:= we force Make to evaluate the Git
version string only during Makefile read, and not on every single build
command execution.

The reduction in file system I/O cut the time to build
examples/er-rest-example on my development machine by a significant
amount, see below.

Core i7 notebook with ext4 file system on an SSD (building for TARGET=mulle):
"RELSTR="  make  19.70s user 1.07s system 82% cpu 25.291 total
"RELSTR:=" make  11.81s user 1.27s system 79% cpu 16.499 total

Signed-off-by: Joakim Gebart <[email protected]>
  • Loading branch information
Joakim Gebart committed Oct 29, 2014
1 parent 6fb7dd2 commit b3dd696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ CFLAGS += ${addprefix -I,$(SOURCEDIRS) $(CONTIKI)}
### 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 --git-dir ${CONTIKI}/.git describe --tags 2>/dev/null}
RELSTR:=${shell git --git-dir ${CONTIKI}/.git describe --tags 2>/dev/null}
ifneq ($(RELSTR),)
CFLAGS += -DCONTIKI_VERSION_STRING=\"Contiki-$(RELSTR)\"
endif
Expand Down

0 comments on commit b3dd696

Please sign in to comment.