summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-08-21 18:53:04 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-08-23 15:04:56 +0200
commit8cf7e68b5320b1f6d26927bd5953db1ae2546d82 (patch)
tree425a4969f645afbc97b52091557f79c3d71c3f14
parentc434e1cd293a22d45ff8575810b4a770ac2cce08 (diff)
Add makefile target for cleaning everything
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c36feaac..7733b506 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@ BIN_TARGETS=$(patsubst imag-%,,$(BINS))
LIB_TARGETS=$(LIBS)
LIB_TARGETS_TEST=$(foreach x,$(subst ./,,$(LIBS)),test-$(x))
TARGETS=$(BIN_TARGETS) $(LIB_TARGETS)
+CLEAN_TARGETS=$(foreach x,$(TARGETS),$(x)-clean)
all: $(TARGETS)
@$(ECHO) "\t[ALL ]"
@@ -25,6 +26,9 @@ lib: $(LIB_TARGETS)
lib-test: $(LIB_TARGETS_TEST)
+clean: $(CLEAN_TARGETS)
+ @$(ECHO) "\t[CLEAN ]"
+
$(TARGETS): %: .FORCE
@$(ECHO) "\t[CARGO ]:\t$@"
@$(CARGO) build --manifest-path ./$@/Cargo.toml
@@ -33,5 +37,9 @@ $(LIB_TARGETS_TEST): %: .FORCE
@$(ECHO) "\t[TEST ]:\t$@"
@$(CARGO) test --manifest-path ./$(subst test-,,$@)/Cargo.toml
+$(CLEAN_TARGETS): %: .FORCE
+ @$(ECHO) "\t[CLEAN]:\t$(subst -clean,,$@)"
+ @$(CARGO) clean --manifest-path ./$(subst -clean,,$@)/Cargo.toml
+
.FORCE: