1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

make: introduce $(CLEAN)

Currently, some targets are serialized before "clean" by conditionally
adding a dependency.

Make does allow ordering using "|" syntax in prerequisites, but for
"clean" that would always trigger the clean target.
By only conditionally setting $(CLEAN) to clean, that can be
circumvented.

The new CLEAN allows any recipe to be run after "clean" by specifying "|
$(CLEAN)" as prerequisite.
This commit is contained in:
Kaspar Schleiser 2019-07-12 12:34:42 +02:00
parent 6b094a78a9
commit cb8e335c29

View File

@ -80,6 +80,13 @@ MAKEOVERRIDES += $(foreach v,$(__DIRECTORY_VARIABLES),$(v)=$($(v)))
# trailing '/' is important when RIOTPROJECT == CURDIR
BUILDRELPATH ?= $(patsubst $(RIOTPROJECT)/%,%,$(CURDIR)/)
# Set CLEAN to "clean" if that target was requested.
# Allows recipes to be run after cleaning, without triggering it implicitly:
#
# all: | $(CLEAN)
#
CLEAN = $(filter clean, $(MAKECMDGOALS))
# include makefiles utils tools
include $(RIOTMAKE)/utils/variables.mk