-
Notifications
You must be signed in to change notification settings - Fork 83
/
Makefile
27 lines (22 loc) · 797 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
GOMOBILE=gomobile
GOBIND=$(GOMOBILE) bind
BUILDDIR=$(shell pwd)/build
IOS_ARTIFACT=$(BUILDDIR)/Tun2socks.framework
ANDROID_ARTIFACT=$(BUILDDIR)/tun2socks.aar
IOS_TARGET=ios
ANDROID_TARGET=android
# LDFLAGS='-s -w -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn'
LDFLAGS='-s -w'
IMPORT_PATH=github.com/xxf098/go-tun2socks-build
BUILD_IOS="cd $(BUILDDIR) && $(GOBIND) -a -ldflags $(LDFLAGS) -target=$(IOS_TARGET) -o $(IOS_ARTIFACT) $(IMPORT_PATH)"
BUILD_ANDROID="cd $(BUILDDIR) && $(GOBIND) -a -ldflags $(LDFLAGS) -target=$(ANDROID_TARGET) -tags=gomobile -o $(ANDROID_ARTIFACT) $(IMPORT_PATH)"
all: ios android
ios:
mkdir -p $(BUILDDIR)
eval $(BUILD_IOS)
android:
rm -rf $(BUILDDIR) 2>/dev/null
mkdir -p $(BUILDDIR)
eval $(BUILD_ANDROID)
clean:
rm -rf $(BUILDDIR)