build system: add fallback for RIOT_VERSION_CODE
If the repository was checked out without tags, parsing RIOT_VERSION will fail. Fall back to creating a fake release version code based on the current year and month.
This commit is contained in:
parent
5e81bd56b0
commit
74a0f8d8b9
@ -58,6 +58,7 @@ PKGDIRBASE ?= $(RIOTBASE)/build/pkg
|
||||
DLCACHE ?= $(RIOTTOOLS)/dlcache/dlcache.sh
|
||||
DLCACHE_DIR ?= $(RIOTBASE)/.dlcache
|
||||
WARNING_EXTERNAL_MODULE_DIRS ?= 1
|
||||
RIOT_VERSION_DUMMY_CODE ?= RIOT_VERSION_NUM\(2042,5,23,0\)
|
||||
|
||||
# include CI info such as BOARD_INSUFFICIENT_MEMORY, if existing
|
||||
-include Makefile.ci
|
||||
@ -487,7 +488,7 @@ endif
|
||||
ifeq ($(RIOT_CI_BUILD),1)
|
||||
RIOT_VERSION ?= buildtest
|
||||
# set a dummy version number
|
||||
RIOT_VERSION_CODE ?= RIOT_VERSION_NUM\(2042,5,23,0\)
|
||||
RIOT_VERSION_CODE ?= $(RIOT_VERSION_DUMMY_CODE)
|
||||
ifneq ($(filter $(BOARD_INSUFFICIENT_MEMORY), $(BOARD)),)
|
||||
$(info CI-build: skipping link step)
|
||||
RIOTNOLINK:=1
|
||||
@ -529,8 +530,9 @@ ifneq (,$(RIOT_VERSION_OVERRIDE))
|
||||
endif
|
||||
|
||||
# Generate machine readable RIOT VERSION macro
|
||||
RIOT_VERSION_CODE ?= $(shell echo ${RIOT_VERSION} | \
|
||||
sed -E 's/([0-9]+).([0-9]+).?([0-9]+)?.*/RIOT_VERSION_NUM\\\(\1,\2,0\3,${RIOT_EXTRAVERSION}\\\)/')
|
||||
RIOT_VERSION_CODE ?= $(shell echo $(RIOT_VERSION) | \
|
||||
sed -E 's/([0-9]+)\.([0-9]+)\.?([0-9]+)?.*/RIOT_VERSION_NUM\\\(\1,\2,0\3,$(RIOT_EXTRAVERSION)\\\)/' | \
|
||||
grep RIOT_VERSION_NUM || echo "$(RIOT_VERSION_DUMMY_CODE)")
|
||||
|
||||
# Set module by prepending APPLICATION name with 'application_'.
|
||||
# It prevents conflict with application and modules with the same name.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user