summaryrefslogtreecommitdiff
path: root/android/Bootstrap
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-08-03 16:39:20 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-08-03 16:41:42 +0100
commite61e51ab96263072df21519c50adb38c4996405c (patch)
treec81aa96e3a02a81326c4d23de2b15669b87632c3 /android/Bootstrap
parent7b75535e2891ff55f3c51f97f7dcb108f938e122 (diff)
android: share more common Makefile pieces between a couple of users
Try to start consolidating the complexity here. generate Application.mk to specify the required ABI fold common distro-config pieces out of README
Diffstat (limited to 'android/Bootstrap')
-rw-r--r--android/Bootstrap/Makefile.shared53
1 files changed, 53 insertions, 0 deletions
diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
new file mode 100644
index 000000000000..6daef1347054
--- /dev/null
+++ b/android/Bootstrap/Makefile.shared
@@ -0,0 +1,53 @@
+#
+# Common Makefile pieces for building Java / Android apps.
+#
+
+# Probably would be best to just stop fooling around with the possibilities to
+# set various stuff with the -env command line parameters (and environment
+# variables?) and in a plethora of rc files, and hardcode construction of
+# *all* required pathnames based on the app installation location for Android
+# (and iOS), etc. We don't really win anything by having so many layers of
+# configurability on platforms like Android and iOS where apps based on LO
+# code are very much self-contained pre-packaged thingies.
+APP_DATA_PATH=/data/data/$(APP_PACKAGE)
+
+# Adapt to both Intel and ARM architectures
+ifeq ($(CPU),I)
+ABI_PATH=x86
+else
+ABI_PATH=armeabi-v7a
+endif
+SODEST=libs/$(ABI_PATH)
+OBJLOCAL=obj/local/$(ABI_PATH)
+
+define COPYSO
+cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
+cp $(1) $(OBJLOCAL)$(if $(2),/$(2))
+endef
+
+define COPYSOJAR
+cp $(1) libs
+endef
+
+#
+# Helpful rules ...
+#
+
+properties:
+ echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
+ echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties
+ echo "APP_ABI := $(ABI_PATH)" > jni/Application.mk
+ echo "APP_PLATFORM := android-14" >> jni/Application.mk
+
+install: build-ant
+ unset JAVA_HOME && $(ANT) debug install
+ @echo
+ @echo 'Run it with something like what "make run" does (see Makefile)'
+ @echo
+
+uninstall:
+ $(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE)
+
+clean: properties
+ $(ANT) clean
+ rm -rf assets $(SODEST) $(OBJLOCAL)