added update target

This commit is contained in:
Mario Krehl 2016-08-24 16:49:08 +02:00
parent ae1e5d6664
commit 8dd4044009

View file

@ -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)
UPDATE_TARGETS=$(foreach x,$(TARGETS),$(x)-update)
CLEAN_TARGETS=$(foreach x,$(TARGETS),$(x)-clean) CLEAN_TARGETS=$(foreach x,$(TARGETS),$(x)-clean)
all: $(TARGETS) all: $(TARGETS)
@ -26,6 +27,9 @@ lib: $(LIB_TARGETS)
lib-test: $(LIB_TARGETS_TEST) lib-test: $(LIB_TARGETS_TEST)
update: $(UPDATE_TARGETS)
@$(ECHO) "\t[UPDATE]"
clean: $(CLEAN_TARGETS) clean: $(CLEAN_TARGETS)
@$(ECHO) "\t[CLEAN ]" @$(ECHO) "\t[CLEAN ]"
@ -37,6 +41,10 @@ $(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
$(UPDATE_TARGETS): %: .FORCE
@$(ECHO) "\t[UPDATE]:\t$(subst -update,,$@)"
@$(CARGO) update --manifest-path ./$(subst -update,,$@)/Cargo.toml
$(CLEAN_TARGETS): %: .FORCE $(CLEAN_TARGETS): %: .FORCE
@$(ECHO) "\t[CLEAN]:\t$(subst -clean,,$@)" @$(ECHO) "\t[CLEAN]:\t$(subst -clean,,$@)"
@$(CARGO) clean --manifest-path ./$(subst -clean,,$@)/Cargo.toml @$(CARGO) clean --manifest-path ./$(subst -clean,,$@)/Cargo.toml