blob: 52ab8680dfb0fdda24ca12cfa09f4109173bc4b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
diff --git a/Makefile b/Makefile
index bcb8312..38960f9 100644
--- a/Makefile
+++ b/Makefile
@@ -4,13 +4,13 @@ GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
VERSION=$(shell git describe --tags)
DEBUG_LDFLAGS=''
-RELEASE_LDFLAGS='-s -w -X main.version=$(VERSION)'
+RELEASE_LDFLAGS='-s -w -X main.version=$(VERSION) -extldflags ${LDFLAGS}'
BUILD_TAGS?=socks
BUILDDIR=$(shell pwd)/build
CMDDIR=$(shell pwd)/cmd/tun2socks
PROGRAM=tun2socks
-BUILD_CMD="cd $(CMDDIR) && $(GOBUILD) -ldflags $(RELEASE_LDFLAGS) -o $(BUILDDIR)/$(PROGRAM) -v -tags '$(BUILD_TAGS)'"
+BUILD_CMD="cd $(CMDDIR) && $(GOBUILD) -trimpath -ldflags $(RELEASE_LDFLAGS) -o $(BUILDDIR)/$(PROGRAM) -v -tags '$(BUILD_TAGS)'"
XBUILD_CMD="cd $(BUILDDIR) && $(XGOCMD) -ldflags $(RELEASE_LDFLAGS) -tags '$(BUILD_TAGS)' --targets=*/* $(CMDDIR)"
all: build
|