Skip to content

Commit

Permalink
Merge pull request #11829 from kaspar030/make_add_clean_variable
Browse files Browse the repository at this point in the history
make: introduce $(CLEAN)
  • Loading branch information
fjmolinas committed Jul 12, 2019
2 parents 6c895e1 + 4e051f8 commit 220ab41
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Makefile.include
Expand Up @@ -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

Expand Down Expand Up @@ -511,9 +518,7 @@ endef
@$(COLOR_ECHO)

# The `clean` needs to be serialized before everything else.
ifneq (, $(filter clean, $(MAKECMDGOALS)))
all $(BASELIBS) $(BUILDDEPS) ..in-docker-container: clean
endif
all $(BASELIBS) $(BUILDDEPS) ..in-docker-container: | $(CLEAN)

.PHONY: pkg-prepare pkg-build pkg-build-%
pkg-prepare:
Expand Down

0 comments on commit 220ab41

Please sign in to comment.