add install target

This commit is contained in:
mario 2016-08-27 12:48:45 +02:00
parent ab4a75421d
commit c7430fd2c3

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