feat: 修改 Makefile

pull/170/head
zhengkunwang223 2023-02-28 14:51:42 +08:00 committed by zhengkunwang223
parent 3456e807a7
commit b655572e5a
1 changed files with 7 additions and 3 deletions

View File

@ -1,8 +1,8 @@
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOARCH=amd64
GOOS=linux
GOARCH=$(shell go env GOARCH)
GOOS=$(shell go env GOOS )
BASE_PAH := $(shell pwd)
BUILD_PATH = $(BASE_PAH)/build
@ -16,6 +16,10 @@ build_web:
build_bin:
cd $(SERVER_PATH) \
&& CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ $(GOBUILD) -trimpath -ldflags '-s -w --extldflags "-static -fpic"' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
&& CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w --extldflags "-static -fpic"' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
build_linux_on_mac:
cd $(SERVER_PATH) \
&& CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ $(GOBUILD) -trimpath -ldflags '-s -w --extldflags "-static -fpic"' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
build_all: build_web build_bin