Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Sep 4, 2014
1 parent 0ce3c97 commit 895d73f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Makefile.housekeeping
Expand Up @@ -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))
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 895d73f

Please sign in to comment.