1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Makefile.include: only keep macros in riotbuild.h

Rely on creating an intermediate riotbuild.h.in file that is updated on
CFLAGS changes, but then generate 'riotbuild.h' without the comments.
The updated timestamp will still trigger a rebuild but not cause ccache
miss due to the content of the CFLAGS that contains absolute path.

This removes the caching issue due to the absolute path that was
added to `CFLAGS` and so the comment in that file.
This commit is contained in:
Gaëtan Harter 2019-10-01 10:49:34 +02:00
parent 49aa83e27e
commit 3bfe30ae57
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -786,9 +786,22 @@ endif
include $(RIOTTOOLS)/desvirt/Makefile.desvirt
# Build a header file with all common macro definitions and undefinitions
# make it depend on FORCE to re-run of the script every time even if the file exists
# The script will only touch the file if anything has changed since last time.
$(RIOTBUILD_CONFIG_HEADER_C): FORCE
# Everytime the header is updated, it will trigger a new compilation.
#
# The file is created first through a `.in` file that will be modified if
# any CFLAGS changed. It depends on FORCE to re-run of the script every time
# even if the file exists but the file will only be updated on modifications.
#
# The header is then created by keeping only the macros. Keeping the
# comments added absolute path in the file that screwed caching.
#
# The rebuild behavior could even only be done with an empty file, but currently
# some macros definitions are passed through this file.
$(RIOTBUILD_CONFIG_HEADER_C): $(RIOTBUILD_CONFIG_HEADER_C).in
$(Q)sed -n -e '1i /* Generated file do not edit */' -e '/^#.*/ p' $< > $@
.SECONDARY: $(RIOTBUILD_CONFIG_HEADER_C).in
$(RIOTBUILD_CONFIG_HEADER_C).in: FORCE | $(CLEAN)
@mkdir -p '$(dir $@)'
$(Q)'$(RIOTTOOLS)/genconfigheader/genconfigheader.sh' $(CFLAGS_WITH_MACROS) \
| '$(LAZYSPONGE)' $(LAZYSPONGE_FLAGS) '$@'