diff --git a/Makefile.include b/Makefile.include index ba19152f37..e0e4412013 100644 --- a/Makefile.include +++ b/Makefile.include @@ -508,13 +508,13 @@ $(RIOTBUILD_CONFIG_HEADER_C): @mkdir -p '$(dir $@)' $(AD)'$(RIOTBASE)/dist/tools/genconfigheader/genconfigheader.sh' '$@' $(CFLAGS_WITH_MACROS) -CFLAGS_WITH_MACROS := $(CFLAGS) -CFLAGS := $(patsubst -D%,,$(CFLAGS)) -CFLAGS := $(patsubst -U%,,$(CFLAGS)) -CFLAGS += -include '$(RIOTBUILD_CONFIG_HEADER_C)' - ifneq (,$(RIOT_VERSION_OVERRIDE)) export CFLAGS += -DRIOT_VERSION=\"$(RIOT_VERSION_OVERRIDE)\" else export CFLAGS += -DRIOT_VERSION=\"$(RIOT_VERSION)\" endif + +CFLAGS_WITH_MACROS := $(CFLAGS) +CFLAGS := $(patsubst -D%,,$(CFLAGS)) +CFLAGS := $(patsubst -U%,,$(CFLAGS)) +CFLAGS += -include '$(RIOTBUILD_CONFIG_HEADER_C)'