diff --git a/Android/jni/apple2ix.mk b/Android/jni/apple2ix.mk index 905f1b60..fde2cf69 100644 --- a/Android/jni/apple2ix.mk +++ b/Android/jni/apple2ix.mk @@ -38,7 +38,11 @@ endif ifeq ($(EMBEDDED_STACKWALKER),1) LOCAL_CPPFLAGS += -DEMBEDDED_STACKWALKER=1 else - $(error OOPS, for now you should build with EMBEDDED_STACKWALKER=1) + ifeq ($(RUNNING_GDB),1) + # nothing to do + else + $(error OOPS, for now you should build with EMBEDDED_STACKWALKER=1) + endif endif LOCAL_SRC_FILES += $(APPLE2_MAIN_SRC) $(APPLE2_META_SRC) $(APPLE2_VIDEO_SRC) $(APPLE2_AUDIO_SRC) @@ -49,5 +53,9 @@ include $(BUILD_SHARED_LIBRARY) # --OR-- Build an executable so native can drive this show #include $(BUILD_EXECUTABLE) -$(call import-module, breakpad/android/google_breakpad) +ifeq ($(RUNNING_GDB),1) + # nothing to do +else + $(call import-module, breakpad/android/google_breakpad) +endif $(call import-module, android/cpufeatures) diff --git a/Android/jni/build.sh b/Android/jni/build.sh index c6d41447..e9ed4af8 100755 --- a/Android/jni/build.sh +++ b/Android/jni/build.sh @@ -3,10 +3,18 @@ package_id="org.deadc0de.apple2ix.basic" apple2_src_path=apple2ix-src glue_srcs="$apple2_src_path/disk.c $apple2_src_path/misc.c $apple2_src_path/display.c $apple2_src_path/vm.c $apple2_src_path/cpu-supp.c $apple2_src_path/audio/speaker.c $apple2_src_path/audio/mockingboard.c" -target_arch=armeabi-v7a usage() { - echo "$0 [--build-release] [--load] [--debug] [--armeabi | --armeabi-v7a]" + if test "$(basename $0)" = "clean" ; then + echo "$0" + echo " # cleans NDK build of $package_id" + elif test "$(basename $0)" = "uninstall" ; then + echo "$0" + echo " # uninstalls $package_id" + else + echo "$0 [build] [load|debug]" + echo " # default builds $package_id and then load or debug" + fi exit 0 } @@ -14,26 +22,14 @@ export EMBEDDED_STACKWALKER=1 while test "x$1" != "x"; do case "$1" in - "--debug") + "debug") do_debug=1 ;; - "--load") + "load") do_load=1 ;; - "--armeabi") - target_arch=armeabi - ;; - - "--v7a") - target_arch=armeabi-v7a - ;; - - "--build-release") - do_release=1 - ;; - "-h") usage ;; @@ -43,7 +39,7 @@ while test "x$1" != "x"; do ;; *) - package_id=$1 + usage ;; esac shift @@ -108,11 +104,7 @@ fi ############################################################################### # build native sources -if test "x$do_release" = "x1" ; then - ndk-build V=1 NDK_MODULE_PATH=. # NDK_TOOLCHAIN_VERSION=clang -else - ndk-build V=1 NDK_MODULE_PATH=. NDK_DEBUG=1 # NDK_TOOLCHAIN_VERSION=clang -fi +ndk-build V=1 NDK_MODULE_PATH=. NDK_DEBUG=1 # NDK_TOOLCHAIN_VERSION=clang ret=$? if test "x$ret" != "x0" ; then exit $ret @@ -179,13 +171,9 @@ fi ############################################################################### if test "x$do_debug" = "x1" ; then + export RUNNING_GDB=1 cd .. - /bin/rm ./libs/gdbserver - /bin/ln -s $target_arch/gdbserver libs/gdbserver - ##/bin/rm ./libs/gdb.setup - ##/bin/ln -s $target_arch/gdb.setup libs/gdb.setup - ##ndk-gdb --verbose --force --launch=org.deadc0de.apple2ix.Apple2Activity - ndk-gdb --nowait --verbose --force --launch=org.deadc0de.apple2ix.Apple2Activity + ndk-gdb --nowait --force --verbose --launch=org.deadc0de.apple2ix.Apple2Activity elif test "x$do_load" = "x1" ; then adb shell am start -a android.intent.action.MAIN -n org.deadc0de.apple2ix.basic/org.deadc0de.apple2ix.Apple2Activity fi