diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-08-03 16:39:20 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-08-03 16:41:42 +0100 |
commit | e61e51ab96263072df21519c50adb38c4996405c (patch) | |
tree | c81aa96e3a02a81326c4d23de2b15669b87632c3 /android | |
parent | 7b75535e2891ff55f3c51f97f7dcb108f938e122 (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')
-rw-r--r-- | android/Bootstrap/Makefile.shared | 53 | ||||
-rw-r--r-- | android/experimental/LibreOffice4Android/Makefile | 51 | ||||
-rw-r--r-- | android/experimental/LibreOffice4Android/jni/Application.mk | 3 | ||||
-rw-r--r-- | android/qa/desktop/Makefile | 46 | ||||
-rw-r--r-- | android/qa/desktop/jni/Application.mk | 2 |
5 files changed, 63 insertions, 92 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) diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile index 94cadc0eaec2..9e6b239f1b74 100644 --- a/android/experimental/LibreOffice4Android/Makefile +++ b/android/experimental/LibreOffice4Android/Makefile @@ -1,46 +1,13 @@ include ../../../config_host.mk +include ../../Bootstrap/Makefile.shared # The package of this app APP_PACKAGE=org.libreoffice -# We can't keep assuming APP_DATA_PATH like this, surely this can vary with -# Android versions and whatnot, this is temporary and works at least with the -# SDK 16 emulator... - -# 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) - -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 COPYJAR -cp $(1) libs -endef - # The default target just builds. all: build-ant -properties: - echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties - echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties - copy-stuff: # First always clean rm -rf libs $(OBJLOCAL) @@ -253,25 +220,11 @@ build-ant: copy-stuff properties unoil \ unoloader \ ); do \ - $(call COPYJAR,$(OUTDIR)/bin/$${F}.jar); \ + $(call COPYSOJAR,$(OUTDIR)/bin/$${F}.jar); \ done # unset JAVA_HOME && $(ANT) debug -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) - run: # /data/local/tmp/sample-document.odt adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity -e input /assets/test1.odt - - -clean: properties - $(ANT) clean - rm -rf assets libs $(SODEST) $(OBJLOCAL) diff --git a/android/experimental/LibreOffice4Android/jni/Application.mk b/android/experimental/LibreOffice4Android/jni/Application.mk index f326d1a59879..9b408d093282 100644 --- a/android/experimental/LibreOffice4Android/jni/Application.mk +++ b/android/experimental/LibreOffice4Android/jni/Application.mk @@ -1,3 +1,2 @@ -# File needed by ndk-gdb -APP_ABI := armeabi-v7a +APP_ABI := x86 APP_PLATFORM := android-14 diff --git a/android/qa/desktop/Makefile b/android/qa/desktop/Makefile index 9630445f4a87..ca4ddc6fd68a 100644 --- a/android/qa/desktop/Makefile +++ b/android/qa/desktop/Makefile @@ -2,6 +2,7 @@ # 'lo_main' from include ../../../config_host.mk +include ../../Bootstrap/Makefile.shared # The package of this app APP_PACKAGE=org.libreoffice.android.libo @@ -9,32 +10,10 @@ APP_PACKAGE=org.libreoffice.android.libo # The name of the Bootstrap activity class BOOTSTRAP=org.libreoffice.android.Bootstrap -# The full path the the app's directory needs to be supplied in a -# couple of places, unfortunately. - -APP_DATA_PATH=/data/data/$(APP_PACKAGE) - -ifeq ($(CPU),I) -ABI_PATH=x86 -else -ABI_PATH=armeabi-v7a -endif -SODEST=libs/$(ABI_PATH) -OBJLOCAL=obj/local/$(ABI_PATH) - -define COPY -cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \ -cp $(1) $(OBJLOCAL)$(if $(2),/$(2)) -endef - # The default target just builds. all: build-ant -properties: - echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties - echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties - buildrcs: # main sofficerc ini ... mkdir -p assets/program/ @@ -53,7 +32,7 @@ buildrcs: echo "LO_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc echo "URE_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc # checkme - is this used to find configs ? echo "BRAND_BASE_DIR=file:///assets" >> assets/program/fundamentalrc - echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry module:$${BRAND_BASE_DIR}/share/registry/modules res:$${BRAND_BASE_DIR}/share/registry user:$${$$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/registrymodifications.xcu' >> assets/program/fundamentalrc + echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry module:$${BRAND_BASE_DIR}/share/registry/modules res:$${BRAND_BASE_DIR}/share/registry' >> assets/program/fundamentalrc echo 'URE_BIN_DIR=file:///assets/ure/bin/dir/not-here/can-we/exec-anyway' >> assets/program/fundamentalrc echo 'URE_MORE_TYPES=file:///assets/ure/share/misc/types.rdb file:///assets/program/types/types.rdb' >> assets/program/fundamentalrc echo 'URE_MORE_SERVICES= <$$BRAND_BASE_DIR/program/services>*' >> assets/program/fundamentalrc @@ -193,12 +172,12 @@ copy-stuff: buildrcs chartmodello \ charttoolslo \ ); do \ - $(call COPY,$(OUTDIR)/lib/lib$${F}.so); \ + $(call COPYSO,$(OUTDIR)/lib/lib$${F}.so); \ done # # Then the shared GNU C++ library - $(call COPY,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/$(ABI_PATH)/libgnustl_shared.so) + $(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ABI_PATH)/libgnustl_shared.so) # # Then other "assets" that can be left in the .apk. Let the directory # structure under assets mimic the install set - except for the fact @@ -238,28 +217,18 @@ copy-stuff: buildrcs # # Then gdbserver and gdb.setup so that we can debug with ndk-gdb. # - cp $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver $(SODEST) + cp $(ANDROID_NDK_GDBSERVER) $(SODEST) echo set solib-search-path ./obj/local/$(ABI_PATH) >$(SODEST)/gdb.setup build-ant: copy-stuff properties unset JAVA_HOME && $(ANT) debug -install: copy-stuff properties - $(ANDROID_SDK_HOME)/platform-tools/adb shell rm -r $(APP_DATA_PATH) - unset JAVA_HOME && $(ANT) debug install - @echo - @echo 'Run it with "make run"' - @echo - -uninstall: - $(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE) - run: echo "-env:INIFILENAME=file:///assets/program/sofficerc" > cmdline # echo "file:///assets/demo/writer.odt" > cmdline $(ANDROID_SDK_HOME)/platform-tools/adb push cmdline $(APP_DATA_PATH)/cmdline - $(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-strace yes -e lo-main-indirect-cmdline "$(APP_DATA_PATH)/cmdline" + $(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-main-delay 20 -e lo-main-indirect-cmdline "$(APP_DATA_PATH)/cmdline" # add -e lo-strace yes # if you want that # If you reinstall an app several times, even if you uninstall it @@ -268,7 +237,4 @@ run: stop-start-cycle: $(ANDROID_SDK_HOME)/platform-tools/adb shell stop && $(ANDROID_SDK_HOME)/platform-tools/adb shell start && sleep 10 -clean: properties - $(ANT) clean - rm -rf assets $(SODEST) $(OBJLOCAL) diff --git a/android/qa/desktop/jni/Application.mk b/android/qa/desktop/jni/Application.mk index a11b28debc0c..9b408d093282 100644 --- a/android/qa/desktop/jni/Application.mk +++ b/android/qa/desktop/jni/Application.mk @@ -1,2 +1,2 @@ -APP_ABI := armeabi-v7a +APP_ABI := x86 APP_PLATFORM := android-14 |