[sdks] Source drop from xamarin/mono-sdks (#5876)
[mono-project.git] / sdks / android / Makefile
blob1c9114aa4868da67f07df3b04aae5e33866763e0
1 TOP=$(realpath $(CURDIR)/../..)
2 include $(TOP)/sdks/paths.mk
3 ADB = $(SDK_DIR)/platform-tools/adb
4 ANDROID = $(SDK_DIR)/tools/android
5 ANT = ant
6 NDK_BUILD = $(NDK_DIR)/ndk-build
8 PACKAGE = org.mono.android.AndroidTestRunner
9 ACTIVITY = org.mono.android.AndroidRunner
11 .PHONY: all
12 all: setup stage-sdk
13 $(MAKE) -C managed all
14 $(NDK_BUILD)
15 $(ANT) debug
17 local.properties:
18 $(ANDROID) update project -p . -t "android-14"
20 setup: local.properties
22 jni/armeabi-v7a jni/arm64-v8a jni/x86 jni/x86_64 assets:
23 mkdir -p $@
25 MONO_LIBS=libMonoPosixHelper.so libmonosgen-2.0.so
27 $(foreach lib,$(MONO_LIBS),jni/armeabi-v7a/$(lib)): jni/armeabi-v7a/%: $(TOP)/sdks/out/android-arm/lib/% jni/armeabi-v7a
28 cp $(TOP)/sdks/out/android-arm/lib/$* $@
30 $(foreach lib,$(MONO_LIBS),jni/arm64-v8a/$(lib)): jni/arm64-v8a/%: $(TOP)/sdks/out/android-arm64/lib/% jni/arm64-v8a
31 cp $(TOP)/sdks/out/android-arm64/lib/$* $@
33 $(foreach lib,$(MONO_LIBS),jni/x86/$(lib)): jni/x86/%: $(TOP)/sdks/out/android-x86/lib/% jni/x86
34 cp $(TOP)/sdks/out/android-x86/lib/$* $@
36 $(foreach lib,$(MONO_LIBS),jni/x86_64/$(lib)): jni/x86_64/%: $(TOP)/sdks/out/android-x86_64/lib/% jni/x86_64
37 cp $(TOP)/sdks/out/android-x86_64/lib/$* $@
39 assets/mconfig: machine.config assets
40 cp machine.config assets/mconfig
42 stage-sdk: $(foreach lib,$(MONO_LIBS),jni/armeabi-v7a/$(lib)) $(foreach lib,$(MONO_LIBS),jni/arm64-v8a/$(lib)) \
43 $(foreach lib,$(MONO_LIBS),jni/x86/$(lib)) $(foreach lib,$(MONO_LIBS),jni/x86_64/$(lib)) assets/mconfig
45 .PHONY: clean
46 clean:
47 $(ANT) clean
49 .PHONY: deploy
50 deploy: all
51 $(ADB) install -r bin/AndroidRunner-debug.apk
53 .PHONY: undeploy
54 undeploy:
55 $(ADB) uninstall $(PACKAGE)
57 .PHONY: redeploy
58 redeploy:
59 $(MAKE) undeploy
60 $(MAKE) deploy
62 .PHONY: run
63 run:
64 $(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER $(PACKAGE)/$(ACTIVITY)
66 .PHONY: kill
67 kill:
68 $(ADB) shell am force-stop $(PACKAGE)
70 .PHONY: logcat
71 logcat:
72 $(ADB) logcat
74 .PHONY: shell
75 shell:
76 $(ADB) shell