add more build targets for amd64 and arm64

This commit is contained in:
c9s 2021-05-07 14:02:13 +08:00
parent 858d6bdf05
commit 97d4732138

View File

@ -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