-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
28 lines (23 loc) · 858 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
GOMOBILE=gomobile
GOBIND=$(GOMOBILE) bind
BUILDDIR=$(shell pwd)/build
IOS_ARTIFACT=$(BUILDDIR)/XRay.xcframework
ANDROID_ARTIFACT=$(BUILDDIR)/xray.aar
IOS_TARGET=ios
IOS_VERSION=12.0
ANDROID_TARGET=android
# LDFLAGS='-s -w -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn'
LDFLAGS='-s -w -extldflags -lresolv'
IMPORT_PATH=github.com/EbrahimTahernejad/xray-mobile
BUILD_IOS="cd $(BUILDDIR) && $(GOBIND) -a -ldflags $(LDFLAGS) -target=$(IOS_TARGET) -iosversion=$(IOS_VERSION) -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)