summaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index b2c69594..c89b23b7 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)