WIP : script wrapper for Android ndk-build

This commit is contained in:
Aaron Culliney 2015-02-15 18:25:54 -08:00
parent 00cec0dcae
commit eced1c9edf
4 changed files with 48 additions and 5 deletions

46
Android/jni/build.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
set -x
apple2_src_path=../../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"
if test "$(basename $0)" = "clean" ; then
/bin/rm $apple2_src_path/rom.c
/bin/rm $apple2_src_path/font.c
/bin/rm $apple2_src_path/glue.S
/bin/rm $apple2_src_path/x86/glue.S
/bin/rm $apple2_src_path/arm/glue.S
ndk-build clean
exit 0
fi
#CC=`which clang`
CC=`which gcc`
CFLAGS="-std=gnu11"
# ROMz
$CC $CFLAGS -o $apple2_src_path/genrom $apple2_src_path/genrom.c && \
$apple2_src_path/genrom $apple2_src_path/rom/apple_IIe.rom $apple2_src_path/rom/slot6.rom > $apple2_src_path/rom.c
# font
$CC $CFLAGS -o $apple2_src_path/genfont $apple2_src_path/genfont.c && \
$apple2_src_path/genfont < $apple2_src_path/font.txt > $apple2_src_path/font.c
# glue
$apple2_src_path/x86/genglue $glue_srcs > $apple2_src_path/x86/glue.S
$apple2_src_path/arm/genglue $glue_srcs > $apple2_src_path/arm/glue.S
ndk-build NDK_DEBUG=1 && ant -f ../build.xml
if test "$(basename $0)" = "run" ; then
ant -f ../build.xml debug install && \
adb shell am start -a android.intent.action.MAIN -n org.deadc0de.apple2/.Apple2Activity
fi
if test "$(basename $0)" = "debug" ; then
echo "TODO FIXME ..."
fi
set +x

1
Android/jni/clean Symbolic link
View File

@ -0,0 +1 @@
build.sh

1
Android/jni/run Symbolic link
View File

@ -0,0 +1 @@
build.sh

View File

@ -1,5 +0,0 @@
#!/bin/sh
ndk-build NDK_DEBUG=1 && \
ant -f ../build.xml debug install && \
adb shell am start -a android.intent.action.MAIN -n org.deadc0de.apple2/.Apple2Activity