Skip to content

Commit

Permalink
Add makefile command for ios/android
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang committed Aug 5, 2020
1 parent 2a4e6ba commit b115a41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ nkn-tunnel
main
Tunnel.framework
tunnel.aar
tunnel.jar
tunnel-sources.jar
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ local_or_with_proxy:

.PHONY: build
build:
rm -rf $(BUILD_DIR)/$(BIN_DIR)
mkdir -p $(BUILD_DIR)/$(BIN_DIR)
GOOS=$(GOOS) GOARCH=$(GOARCH) $(BUILD) -o $(BUILD_DIR)/$(BIN_DIR)/$(BIN_NAME)$(EXT) $(MAIN)
${MAKE} zip
Expand All @@ -32,7 +33,7 @@ tar:

.PHONY: zip
zip:
cd $(BUILD_DIR) && rm -f $(BIN_DIR).zip && zip --exclude "*.DS_Store*" --exclude "*__MACOSX*" -r $(BIN_DIR).zip $(BIN_DIR)
cd $(BUILD_DIR) && rm -f $(BIN_DIR).zip && zip --symlinks --exclude "*.DS_Store*" --exclude "*__MACOSX*" -r $(BIN_DIR).zip $(BIN_DIR)

.PHONY: all
all:
Expand All @@ -43,8 +44,16 @@ all:

.PHONY: ios
ios:
rm -rf $(BUILD_DIR)/ios Tunnel.framework
mkdir -p $(BUILD_DIR)/ios
gomobile bind -target=ios -ldflags "-s -w" github.com/nknorg/nkn-tunnel github.com/nknorg/nkn-tuna-session github.com/nknorg/ncp-go github.com/nknorg/tuna
mv Tunnel.framework $(BUILD_DIR)/ios/
${MAKE} zip BIN_DIR=ios

.PHONY: android
android:
rm -rf $(BUILD_DIR)/android tunnel.aar tunnel-sources.jar
mkdir -p $(BUILD_DIR)/android
gomobile bind -target=android -ldflags "-s -w" github.com/nknorg/nkn-tunnel github.com/nknorg/nkn-tuna-session github.com/nknorg/ncp-go github.com/nknorg/tuna
mv tunnel.aar tunnel-sources.jar $(BUILD_DIR)/android/
${MAKE} zip BIN_DIR=android

0 comments on commit b115a41

Please sign in to comment.