Improve dependencies for include/nuttx/version.h
`include/nuttx/version.h` is dependent on `.version`, which needs to run for every invocation of make, since git info can update at any time. Currently the `.version` target is PHONY, thus making `include/nuttx/version.h` and `context` targets (and every target that depends on `context`) have to run every time. This PR modifies `.version` so it's a real rule. Additionally, `tools/version.sh` is run every invocation of make. This maintains the current behavior while preventing some targets from needlessly running every time
This commit is contained in:
parent
828f04f0e5
commit
0951f70df6
|
@ -42,10 +42,12 @@ CONFIG_VERSION_BUILD ?= "0"
|
|||
VERSION_ARG = -v $(CONFIG_VERSION_STRING) -b $(CONFIG_VERSION_BUILD)
|
||||
else
|
||||
|
||||
# Generate .version every time from GIT history
|
||||
|
||||
.PHONY: $(TOPDIR)/.version
|
||||
# Generate .version.tmp every time from GIT history
|
||||
# Only update .version if the contents of version.tmp actually changes
|
||||
# Note: this is executed before any rule is run
|
||||
|
||||
$(shell tools/version.sh .version.tmp)
|
||||
$(shell $(call TESTANDREPLACEFILE, .version.tmp, .version))
|
||||
endif
|
||||
|
||||
# Process architecture specific directories
|
||||
|
@ -225,8 +227,7 @@ $(TOPDIR)/.version:
|
|||
|
||||
include/nuttx/version.h: $(TOPDIR)/.version tools/mkversion$(HOSTEXEEXT)
|
||||
$(Q) echo "Create version.h"
|
||||
$(Q) tools/mkversion $(TOPDIR) > $@.tmp
|
||||
$(Q) $(call TESTANDREPLACEFILE, $@.tmp, $@)
|
||||
$(Q) tools/mkversion $(TOPDIR) > $@
|
||||
|
||||
# Targets used to build include/nuttx/config.h. Creation of config.h is
|
||||
# part of the overall NuttX configuration sequence. Notice that the
|
||||
|
|
Loading…
Reference in New Issue