This repository was archived by the owner on Apr 3, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -4,21 +4,27 @@ GOBUILD=$(GOCMD) build
44GOCLEAN =$(GOCMD ) clean
55VERSION =$(shell git describe --tags)
66DEBUG_LDFLAGS =''
7- RELEASE_LDFLAGS =' -s -w -X main.version=$(VERSION ) '
7+ RELEASE_LDFLAGS =-s -w -X main.version=$(VERSION )
88BUILD_TAGS? =socks
99BUILDDIR =$(shell pwd) /build
1010CMDDIR =$(shell pwd) /cmd/tun2socks
1111PROGRAM =tun2socks
1212
13- BUILD_CMD ="cd $(CMDDIR ) && $(GOBUILD ) -ldflags $(RELEASE_LDFLAGS ) -o $(BUILDDIR ) /$(PROGRAM ) -v -tags '$(BUILD_TAGS ) '"
14- XBUILD_CMD ="cd $(BUILDDIR ) && $(XGOCMD ) -ldflags $(RELEASE_LDFLAGS ) -tags '$(BUILD_TAGS ) ' --targets=*/* $(CMDDIR ) "
13+ BUILD_CMD ="cd $(CMDDIR ) && $(GOBUILD ) -ldflags '$(RELEASE_LDFLAGS ) ' -o $(BUILDDIR ) /$(PROGRAM ) -v -tags '$(BUILD_TAGS ) '"
14+ BUILD_MUSL_CMD ="cd $(CMDDIR ) && CC=musl-gcc $(GOBUILD ) -ldflags '$(RELEASE_LDFLAGS ) -linkmode external -extldflags \"-static\" ' -o $(BUILDDIR ) /$(PROGRAM ) -v -tags '$(BUILD_TAGS ) '"
15+ XBUILD_CMD ="cd $(BUILDDIR ) && $(XGOCMD ) -ldflags '$(RELEASE_LDFLAGS ) ' -tags '$(BUILD_TAGS ) ' --targets=*/* $(CMDDIR ) "
1516
1617all : build
1718
1819build :
1920 mkdir -p $(BUILDDIR )
2021 eval $(BUILD_CMD )
2122
23+ build_musl :
24+ mkdir -p $(BUILDDIR )
25+ eval $(BUILD_CMD )
26+
27+
2228xbuild :
2329 mkdir -p $(BUILDDIR )
2430 eval $(XBUILD_CMD )
Original file line number Diff line number Diff line change @@ -20,3 +20,13 @@ The following projects are using go-tun2socks:
2020
2121- https://github.com/mellow-io/mellow
2222- https://github.com/eycorsican/kitsunebi-android
23+
24+ -------
25+ ## build for musl
26+ This build target depends on musl-gcc which can find in system path
27+
28+ You can build for musl system by using this command
29+ ``` bash
30+ make build_musl
31+ ```
32+
You can’t perform that action at this time.
0 commit comments