fix build crash

This commit is contained in:
Jason
2019-08-14 21:43:38 +08:00
parent 899e154c92
commit 944292048f
3 changed files with 7 additions and 7 deletions
+5 -3
View File
@@ -4,15 +4,17 @@ CMD_DIR=$(shell pwd)/cmd
VERSION=$(shell git describe --tags --long || echo "unknown version")
BUILD_TIME=$(shell date -u)
BUILD_TAGS='fakeDNS stats'
BUILD_LDFLAGS='-s -w -X "github.com/xjasonlyu/tun2socks/constant.Version=$(VERSION)" -X "github.com/xjasonlyu/tun2socks/constant.BuildTime=$(BUILD_TIME)"'
GOBUILD=go build -ldflags -X "github.com/xjasonlyu/tun2socks/constant.Version=$(VERSION)" \
-X "github.com/xjasonlyu/tun2socks/constant.BuildTime=$(BUILD_TIME)" \
-s -w
all: build
build:
cd $(CMD_DIR) && go build -ldflags $(BUILD_LDFLAGS) -v -tags $(BUILD_TAGS) -o $(BUILD_DIR)/$(NAME)
cd $(CMD_DIR) && $(GOBUILD) -v -tags $(BUILD_TAGS) -o $(BUILD_DIR)/$(NAME)
debug:
cd $(CMD_DIR) && go build -ldflags $(BUILD_LDFLAGS) -v -tags $(BUILD_TAGS) -race -o $(BUILD_DIR)/$(NAME)
cd $(CMD_DIR) && $(GOBUILD) -v -tags $(BUILD_TAGS) -race -o $(BUILD_DIR)/$(NAME)
clean:
rm -rf $(BUILD_DIR)