forked from p4gefau1t/trojan-go-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (22 loc) · 846 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
28
29
BUILDDIR=$(shell pwd)/build
IMPORT_PATH= \
github.com/trojan-gfw/igniter-go-libs/clash \
github.com/trojan-gfw/igniter-go-libs/tun2socks \
github.com/trojan-gfw/igniter-go-libs/freeport \
github.com/trojan-gfw/igniter-go-libs/util \
github.com/trojan-gfw/igniter-go-libs/trojan
# pass a single dollar sign to shell
CURRENT_GOPATH="$(shell echo $$GOPATH)"
CURRENT_WORKDIR="$(shell pwd)"
all: ios android
ios: clean
mkdir -p $(BUILDDIR)
gomobile bind -o $(BUILDDIR)/golibs.framework -a -ldflags '-w' -target=ios $(IMPORT_PATH)
android: clean
mkdir -p $(BUILDDIR)
env GO111MODULE="on" gomobile bind -o $(BUILDDIR)/golibs.aar -a -v -x -ldflags '-w' -target=android -gcflags=-trimpath=$(CURRENT_GOPATH) -gcflags=-trimpath=$(CURRENT_WORKDIR) $(IMPORT_PATH)
clean:
gomobile clean
rm -rf $(BUILDDIR)
cleanmodcache:
go clean -modcache