1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

Makefile.include: Only evaluate RIOT_VERSION when needed

This changes CFLAGS_WITH_MACROS to be:

* a deferred variable
* not exported so only evaluated when actually used

The value is only used by `Makefile.include` and `makefiles/eclipse.inc.mk`
so not required to export it.
This commit is contained in:
Gaëtan Harter 2019-07-22 12:03:05 +02:00
parent cfd4677315
commit 8859e1e1d9
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -721,12 +721,14 @@ $(RIOTBUILD_CONFIG_HEADER_C): FORCE
$(Q)'$(RIOTTOOLS)/genconfigheader/genconfigheader.sh' $(CFLAGS_WITH_MACROS) \
| '$(LAZYSPONGE)' $(LAZYSPONGE_FLAGS) '$@'
CFLAGS_WITH_MACROS := $(CFLAGS)
# Immediate evaluation but keep CLAGS_WITH_MACROS deferred
_CFLAGS := $(CFLAGS)
CFLAGS_WITH_MACROS = $(_CFLAGS)
ifneq (,$(RIOT_VERSION_OVERRIDE))
export CFLAGS_WITH_MACROS += -DRIOT_VERSION=\"$(RIOT_VERSION_OVERRIDE)\"
CFLAGS_WITH_MACROS += -DRIOT_VERSION=\"$(RIOT_VERSION_OVERRIDE)\"
else
export CFLAGS_WITH_MACROS += -DRIOT_VERSION=\"$(RIOT_VERSION)\"
CFLAGS_WITH_MACROS += -DRIOT_VERSION=\"$(RIOT_VERSION)\"
endif
CFLAGS := $(patsubst -D%,,$(CFLAGS))