From: Michael Brown Date: Thu, 4 Sep 2014 15:46:59 +0000 (+0100) Subject: [build] Clean up all binary directories on "make [very]clean" X-Git-Tag: v1.20.1~1054 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=895d73f383f5af003ab2e5105e54c9a90b224e77;p=thirdparty%2Fipxe.git [build] Clean up all binary directories on "make [very]clean" Allow a straightforward "make clean" or "make veryclean" to apply to all binary directories (using the shell pattern "bin{,-*}"). Individual binary directories can be cleaned using e.g. make bin clean make bin-x86_64-efi clean Reported-by: Robin Smidsrød Signed-off-by: Michael Brown --- diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index b2c695947..c89b23b7d 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -229,7 +229,7 @@ endif # Determine how many different BIN directories are mentioned in the # make goals. # -BIN_GOALS := $(filter bin/% bin-%,$(MAKECMDGOALS)) +BIN_GOALS := $(filter bin bin/% bin-%,$(MAKECMDGOALS)) BIN_GOALS_BINS := $(sort $(foreach BG,$(BIN_GOALS),\ $(firstword $(subst /, ,$(BG))))) NUM_BINS := $(words $(BIN_GOALS_BINS)) @@ -1439,6 +1439,13 @@ hci/keymap/keymap_%.c : # # Clean-up # + +ifeq ($(NUM_BINS),0) +ALLBINS := bin{,-*} +CLEANUP := $(patsubst $(BIN)/%,$(ALLBINS)/%,$(CLEANUP)) +VERYCLEANUP := $(patsubst $(BIN)/%,$(ALLBINS)/%,$(VERYCLEANUP)) +endif + clean : $(RM) $(CLEANUP)