Merge pull request #665 from mario-kr/add_update-target
Add update target in Makefile
This commit is contained in:
commit
c7cdac5646
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)
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in a new issue