simplify makefile targets for slim binaries

This commit is contained in:
c9s 2021-05-08 01:47:20 +08:00
parent 22ee727dc0
commit 7cb425d33d

View File

@ -96,11 +96,14 @@ desktop: desktop-osx
$(DIST_DIR)/$(VERSION):
mkdir -p $(DIST_DIR)/$(VERSION)
$(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-%.tar.gz:
$(eval BIN_SUFFIX := $(subst bbgo-$(VERSION)-,,$(basename $(basename $(notdir $@)))))
$(eval BIN_NAME := $(subst $(VERSION)-,,$(basename $(basename $(notdir $@)))))
$(MAKE) $(BIN_NAME)
tar -C $(BIN_DIR) -cvzf $@ $(BIN_NAME)
$(DIST_DIR)/$(VERSION)/bbgo-slim-$(VERSION)-%.tar.gz: bbgo-slim-% $(DIST_DIR)/$(VERSION)
tar -C $(BIN_DIR) -cvzf $@ $<
ifeq ($(SIGN),1)
gpg --yes --detach-sign --armor $@
endif
$(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-%.tar.gz: bbgo-% $(DIST_DIR)/$(VERSION)
tar -C $(BIN_DIR) -cvzf $@ $<
ifeq ($(SIGN),1)
gpg --yes --detach-sign --armor $@
endif