diff --git a/tools/Makefile.unix b/tools/Makefile.unix index faf995efca..0bf9ce36d1 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -36,9 +36,15 @@ TOPDIR := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'} -include $(TOPDIR)/.config +-include $(TOPDIR)/.version include $(TOPDIR)/tools/Config.mk -include $(TOPDIR)/Make.defs +# In case .version file does not exist + +CONFIG_VERSION_STRING ?= "0.0" +CONFIG_VERSION_BUILD ?= "0" + # Control build verbosity # # V=1,2: Enable echo of commands @@ -263,7 +269,7 @@ tools/mkversion$(HOSTEXEEXT): $(TOPDIR)/.version: $(Q) echo "Create .version" - $(Q) tools/version.sh .version + $(Q) tools/version.sh -v $(CONFIG_VERSION_STRING) -b $(CONFIG_VERSION_BUILD) .version $(Q) chmod 755 .version include/nuttx/version.h: $(TOPDIR)/.version tools/mkversion$(HOSTEXEEXT) diff --git a/tools/Makefile.win b/tools/Makefile.win index cca58957d0..8fbd1fe365 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -37,9 +37,17 @@ export SHELL=cmd TOPDIR := ${shell echo %CD%} -include $(TOPDIR)\.config +-include $(TOPDIR)/.version -include $(TOPDIR)\tools\Config.mk -include $(TOPDIR)\Make.defs +# In case .version file does not exist + +CONFIG_VERSION_STRING ?= "Unversioned" +CONFIG_VERSION_MAJOR ?= 0 +CONFIG_VERSION_MINOR ?= 0 +CONFIG_VERSION_BUILD ?= "0" + # Control build verbosity # # V=1,2: Enable echo of commands