make: autodetect default SETTINGS

Use the oldest available version. We only keep the current version
and the next in these directories by default, otherwise use SETTINGS
or CONFIGDIR overrides directly.
This commit is contained in:
Franco Fichtner 2021-07-26 14:10:53 +02:00
parent feab3fbeaf
commit 99f7dbec73
1 changed files with 6 additions and 5 deletions

View File

@ -56,13 +56,14 @@ lint: lint-steps lint-composite
TOOLSDIR?= /usr/tools
TOOLSBRANCH?= master
.if defined(CONFIGDIR)
SETTINGS= ${CONFIGDIR:C/^.*\///}
.else
SETTINGS?= 21.1
.if defined(SETTINGS)
_CONFIGDIR= ${TOOLSDIR}/config/${SETTINGS}
.elif !defined(CONFIGDIR)
_CONFIGDIR!= find -s ${TOOLSDIR}/config -type d -depth 1
.endif
CONFIGDIR?= ${TOOLSDIR}/config/${SETTINGS}
CONFIGDIR= ${_CONFIGDIR:[1]}
SETTINGS?= ${CONFIGDIR:C/^.*\///}
.include "${CONFIGDIR}/build.conf"
.-include "${CONFIGDIR}/build.conf.local"