From 97d473213886b60c2e9122fe10f49ec99227f1e5 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 7 May 2021 14:02:13 +0800 Subject: [PATCH] add more build targets for amd64 and arm64 --- Makefile | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 795676e88..841b5113c 100644 --- a/Makefile +++ b/Makefile @@ -20,17 +20,47 @@ all: bbgo-linux bbgo-darwin $(BIN_DIR): mkdir -p $@ + +# build native bbgo +bbgo: + go build -tags web,release -o $(BIN_DIR)/$@ ./cmd/bbgo + +# build native bbgo (slim version) +bbgo-slim: + go build -tags release -o $(BIN_DIR)/$@ ./cmd/bbgo + +# build cross-compile linux bbgo bbgo-linux: $(BIN_DIR) GOOS=linux GOARCH=$(TARGET_ARCH) go build -tags web,release -o $(BIN_DIR)/$@ ./cmd/bbgo +# build cross-compile linux bbgo (slim version) +bbgo-slim-linux: bbgo-slim-linux-amd64 bbgo-slim-linux-arm64 + +bbgo-slim-linux-amd64: $(BIN_DIR) + GOOS=linux GOARCH=amd64 go build -tags release -o $(BIN_DIR)/$@ ./cmd/bbgo + +bbgo-slim-linux-arm64: $(BIN_DIR) + GOOS=linux GOARCH=arm64 go build -tags release -o $(BIN_DIR)/$@ ./cmd/bbgo + +bbgo-darwin: bbgo-darwin-arm64 bbgo-darwin-amd64 + +bbgo-darwin-arm64: $(BIN_DIR) + GOOS=darwin GOARCH=arm64 go build -tags web,release -o $(BIN_DIR)/$@ ./cmd/bbgo + +bbgo-darwin-amd64: $(BIN_DIR) + GOOS=darwin GOARCH=amd64 go build -tags web,release -o $(BIN_DIR)/$@ ./cmd/bbgo + bbgo-darwin: $(BIN_DIR) GOOS=darwin GOARCH=$(TARGET_ARCH) go build -tags web,release -o $(BIN_DIR)/$@ ./cmd/bbgo -bbgo-slim-darwin: $(BIN_DIR) - GOOS=darwin GOARCH=$(TARGET_ARCH) go build -tags release -o $(BIN_DIR)/$@ ./cmd/bbgo +bbgo-slim-darwin-arm64: $(BIN_DIR) + GOOS=darwin GOARCH=arm64 go build -tags release -o $(BIN_DIR)/$@ ./cmd/bbgo + +bbgo-slim-darwin-amd64: $(BIN_DIR) + GOOS=darwin GOARCH=amd64 go build -tags release -o $(BIN_DIR)/$@ ./cmd/bbgo + +bbgo-slim-darwin: bbgo-slim-darwin-amd64 bbgo-slim-darwin-arm64 -bbgo-slim-linux: $(BIN_DIR) - GOOS=linux GOARCH=$(TARGET_ARCH) go build -tags release -o $(BIN_DIR)/$@ ./cmd/bbgo clean: rm -rf $(BUILD_DIR) $(DIST_DIR) $(FRONTEND_EXPORT_DIR) @@ -104,4 +134,4 @@ embed: pkg/server/assets.go static: frontend/out/index.html pkg/server/assets.go -.PHONY: bbgo version dist migrations static embed desktop .FORCE +.PHONY: bbgo bbgo-slim-darwin bbgo-slim-darwin-amd64 bbgo-slim-darwin-arm64 bbgo-darwin version dist migrations static embed desktop .FORCE