Add makefile target for cleaning everything
This commit is contained in:
parent
c434e1cd29
commit
8cf7e68b53
1 changed files with 8 additions and 0 deletions
8
Makefile
8
Makefile
|
@ -13,6 +13,7 @@ BIN_TARGETS=$(patsubst imag-%,,$(BINS))
|
||||||
LIB_TARGETS=$(LIBS)
|
LIB_TARGETS=$(LIBS)
|
||||||
LIB_TARGETS_TEST=$(foreach x,$(subst ./,,$(LIBS)),test-$(x))
|
LIB_TARGETS_TEST=$(foreach x,$(subst ./,,$(LIBS)),test-$(x))
|
||||||
TARGETS=$(BIN_TARGETS) $(LIB_TARGETS)
|
TARGETS=$(BIN_TARGETS) $(LIB_TARGETS)
|
||||||
|
CLEAN_TARGETS=$(foreach x,$(TARGETS),$(x)-clean)
|
||||||
|
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
@$(ECHO) "\t[ALL ]"
|
@$(ECHO) "\t[ALL ]"
|
||||||
|
@ -25,6 +26,9 @@ lib: $(LIB_TARGETS)
|
||||||
|
|
||||||
lib-test: $(LIB_TARGETS_TEST)
|
lib-test: $(LIB_TARGETS_TEST)
|
||||||
|
|
||||||
|
clean: $(CLEAN_TARGETS)
|
||||||
|
@$(ECHO) "\t[CLEAN ]"
|
||||||
|
|
||||||
$(TARGETS): %: .FORCE
|
$(TARGETS): %: .FORCE
|
||||||
@$(ECHO) "\t[CARGO ]:\t$@"
|
@$(ECHO) "\t[CARGO ]:\t$@"
|
||||||
@$(CARGO) build --manifest-path ./$@/Cargo.toml
|
@$(CARGO) build --manifest-path ./$@/Cargo.toml
|
||||||
|
@ -33,5 +37,9 @@ $(LIB_TARGETS_TEST): %: .FORCE
|
||||||
@$(ECHO) "\t[TEST ]:\t$@"
|
@$(ECHO) "\t[TEST ]:\t$@"
|
||||||
@$(CARGO) test --manifest-path ./$(subst test-,,$@)/Cargo.toml
|
@$(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:
|
.FORCE:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue