2015-02-16 02:25:54 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-03-10 20:38:14 +00:00
|
|
|
package_id="org.deadc0de.apple2ix"
|
2015-03-10 20:15:36 +00:00
|
|
|
apple2_src_path=apple2ix-src
|
2015-02-18 04:28:23 +00:00
|
|
|
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"
|
2015-02-19 00:18:38 +00:00
|
|
|
do_load=0
|
|
|
|
do_debug=0
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
echo "$0 [--load|--debug]"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
while test "x$1" != "x"; do
|
|
|
|
case "$1" in
|
|
|
|
"--debug")
|
|
|
|
do_load=1
|
|
|
|
do_debug=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
"--load")
|
|
|
|
do_load=1
|
|
|
|
do_debug=0
|
|
|
|
;;
|
|
|
|
|
|
|
|
"-h")
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
|
|
|
|
"--help")
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
|
2015-03-15 22:52:10 +00:00
|
|
|
*)
|
|
|
|
package_id=$1
|
|
|
|
;;
|
2015-02-19 00:18:38 +00:00
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
/bin/rm Android.mk
|
2015-02-16 02:25:54 +00:00
|
|
|
|
|
|
|
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/x86/glue.S
|
|
|
|
/bin/rm $apple2_src_path/arm/glue.S
|
2015-02-18 19:34:09 +00:00
|
|
|
|
2015-02-19 00:18:38 +00:00
|
|
|
# considered dangerous
|
|
|
|
/bin/rm -rf ../bin
|
|
|
|
/bin/rm -rf ../libs
|
|
|
|
/bin/rm -rf ../gen
|
|
|
|
/bin/rm -rf ../obj
|
2015-02-18 19:34:09 +00:00
|
|
|
|
2015-02-19 00:18:38 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
2015-02-18 19:34:09 +00:00
|
|
|
|
2015-02-19 00:18:38 +00:00
|
|
|
if test "$(basename $0)" = "uninstall" ; then
|
|
|
|
adb uninstall $package_id
|
2015-02-16 02:25:54 +00:00
|
|
|
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
|
|
|
|
|
2015-02-18 19:34:09 +00:00
|
|
|
if test "$(basename $0)" = "testcpu" ; then
|
|
|
|
ln -s testcpu.mk Android.mk
|
|
|
|
elif test "$(basename $0)" = "testvm" ; then
|
|
|
|
ln -s testvm.mk Android.mk
|
|
|
|
elif test "$(basename $0)" = "testdisplay" ; then
|
|
|
|
ln -s testdisplay.mk Android.mk
|
|
|
|
elif test "$(basename $0)" = "testdisk" ; then
|
|
|
|
ln -s testdisk.mk Android.mk
|
|
|
|
else
|
|
|
|
ln -s apple2ix.mk Android.mk
|
|
|
|
fi
|
2015-02-16 02:25:54 +00:00
|
|
|
|
2015-05-10 21:06:20 +00:00
|
|
|
ndk-build V=1 NDK_DEBUG=1
|
|
|
|
#ndk-build V=1 NDK_DEBUG=1 && \
|
|
|
|
# ant -f ../build.xml debug
|
|
|
|
|
|
|
|
#if test "x$do_load" = "x1" ; then
|
|
|
|
# ant -f ../build.xml debug install
|
|
|
|
#fi
|
|
|
|
#
|
|
|
|
#if test "x$do_debug" = "x1" ; then
|
|
|
|
# ( cd .. && ndk-gdb.py --force --start )
|
|
|
|
#elif test "x$do_load" = "x1" ; then
|
|
|
|
# adb shell am start -a android.intent.action.MAIN -n $package_id/.Apple2Activity
|
|
|
|
#fi
|
2015-02-18 19:34:09 +00:00
|
|
|
|
2015-02-16 02:25:54 +00:00
|
|
|
set +x
|
|
|
|
|