Updated use of GOPROXY param in Makefile.

This commit is contained in:
genxium 2022-11-28 23:49:46 +08:00
parent ca5ba83b07
commit 9469b27348
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
PROJECTNAME=server.exe
ROOT_DIR=.
GOPROXY=https://mirrors.aliyun.com/goproxy
all: help
gen-constants:
@ -13,13 +14,13 @@ run-test-and-hotreload:
ServerEnv=TEST CompileDaemon -log-prefix=false -build="go build" -command="./$(PROJECTNAME)"
build:
go build -o $(ROOT_DIR)/$(PROJECTNAME)
GOPROXY=$(GOPROXY) go build -o $(ROOT_DIR)/$(PROJECTNAME)
run-prod: build-prod
./$(PROJECTNAME)
build-prod:
go build -ldflags "-s -w -X main.VERSION=$(shell git rev-parse --short HEAD)-$(shell date "+%Y%m%d-%H:%M:%S")" -o $(ROOT_DIR)/$(PROJECTNAME)
GOPROXY=$(GOPROXY) go build -ldflags "-s -w -X main.VERSION=$(shell git rev-parse --short HEAD)-$(shell date "+%Y%m%d-%H:%M:%S")" -o $(ROOT_DIR)/$(PROJECTNAME)
.PHONY: help

View File

@ -5,7 +5,7 @@ all: help
GOPROXY=https://mirrors.aliyun.com/goproxy
build:
go build -o $(ROOT_DIR)/$(PROJECTNAME)
GOPROXY=$(GOPROXY) go build -o $(ROOT_DIR)/$(PROJECTNAME)
run: build
./$(PROJECTNAME)