use wildcard to build dist files

This commit is contained in:
c9s 2021-05-08 01:16:36 +08:00
parent fd7081e96f
commit 22ee727dc0

View File

@ -96,19 +96,26 @@ desktop: desktop-osx
$(DIST_DIR)/$(VERSION): $(DIST_DIR)/$(VERSION):
mkdir -p $(DIST_DIR)/$(VERSION) mkdir -p $(DIST_DIR)/$(VERSION)
$(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-linux-amd64.tar.gz $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-darwin-amd64.tar.gz $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-linux-arm64.tar.gz $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-darwin-arm64.tar.gz: $(DIST_DIR)/$(VERSION) $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-%.tar.gz:
$(eval BIN_SUFFIX := $(subst bbgo-$(VERSION)-,,$(basename $(basename $(notdir $@))))) $(eval BIN_SUFFIX := $(subst bbgo-$(VERSION)-,,$(basename $(basename $(notdir $@)))))
$(eval BIN_NAME := $(subst $(VERSION)-,,$(basename $(basename $(notdir $@))))) $(eval BIN_NAME := $(subst $(VERSION)-,,$(basename $(basename $(notdir $@)))))
$(MAKE) bbgo-$(BIN_SUFFIX) $(MAKE) $(BIN_NAME)
$(MAKE) bbgo-slim-$(BIN_SUFFIX)
tar -C $(BIN_DIR) -cvzf $@ $(BIN_NAME) tar -C $(BIN_DIR) -cvzf $@ $(BIN_NAME)
ifeq ($(SIGN),1) ifeq ($(SIGN),1)
gpg --yes --detach-sign --armor $@ gpg --yes --detach-sign --armor $@
endif endif
dist-bbgo-linux: $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-linux-arm64.tar.gz $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-linux-amd64.tar.gz dist-bbgo-linux: \
$(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-linux-arm64.tar.gz \
$(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-linux-amd64.tar.gz \
$(DIST_DIR)/$(VERSION)/bbgo-slim-$(VERSION)-linux-arm64.tar.gz \
$(DIST_DIR)/$(VERSION)/bbgo-slim-$(VERSION)-linux-amd64.tar.gz
dist-bbgo-darwin: $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-darwin-arm64.tar.gz $(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-darwin-amd64.tar.gz dist-bbgo-darwin: \
$(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-darwin-arm64.tar.gz \
$(DIST_DIR)/$(VERSION)/bbgo-$(VERSION)-darwin-amd64.tar.gz \
$(DIST_DIR)/$(VERSION)/bbgo-slim-$(VERSION)-darwin-arm64.tar.gz \
$(DIST_DIR)/$(VERSION)/bbgo-slim-$(VERSION)-darwin-amd64.tar.gz
dist: static dist-bbgo-linux dist-bbgo-darwin desktop dist: static dist-bbgo-linux dist-bbgo-darwin desktop