Parcourir la source

[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>
tags/v1.20.1
Michael Brown il y a 10 ans
Parent
révision
895d73f383
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. 8
    1
      src/Makefile.housekeeping

+ 8
- 1
src/Makefile.housekeeping Voir le fichier

@@ -229,7 +229,7 @@ endif
229 229
 # Determine how many different BIN directories are mentioned in the
230 230
 # make goals.
231 231
 #
232
-BIN_GOALS	:= $(filter bin/% bin-%,$(MAKECMDGOALS))
232
+BIN_GOALS	:= $(filter bin bin/% bin-%,$(MAKECMDGOALS))
233 233
 BIN_GOALS_BINS	:= $(sort $(foreach BG,$(BIN_GOALS),\
234 234
 				    $(firstword $(subst /, ,$(BG)))))
235 235
 NUM_BINS	:= $(words $(BIN_GOALS_BINS))
@@ -1439,6 +1439,13 @@ hci/keymap/keymap_%.c :
1439 1439
 #
1440 1440
 # Clean-up
1441 1441
 #
1442
+
1443
+ifeq ($(NUM_BINS),0)
1444
+ALLBINS		:= bin{,-*}
1445
+CLEANUP		:= $(patsubst $(BIN)/%,$(ALLBINS)/%,$(CLEANUP))
1446
+VERYCLEANUP	:= $(patsubst $(BIN)/%,$(ALLBINS)/%,$(VERYCLEANUP))
1447
+endif
1448
+
1442 1449
 clean :
1443 1450
 	$(RM) $(CLEANUP)
1444 1451
 

Chargement…
Annuler
Enregistrer