mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-24 20:31:12 +00:00
Break up build to accommodate multiple targets (including test targets)
This commit is contained in:
parent
78325ad469
commit
fd346ce7eb
3
.gitignore
vendored
3
.gitignore
vendored
@ -70,3 +70,6 @@ Android/bin
|
||||
Android/gen
|
||||
Android/libs
|
||||
|
||||
# Android.mk is tEh dynamicz!
|
||||
Android/jni/Android.mk
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
android:name=".Apple2Activity"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@ -1,73 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
PACKAGE_IDENTIFIER := "org.deadc0de.apple2"
|
||||
PACKAGE_NAME := "apple2ix"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Various sources
|
||||
|
||||
APPLE2_SRC_PATH := ../../src
|
||||
|
||||
APPLE2_X86_SRC := \
|
||||
$(APPLE2_SRC_PATH)/x86/glue.S $(APPLE2_SRC_PATH)/x86/cpu.S
|
||||
|
||||
APPLE2_ARM_SRC := \
|
||||
$(APPLE2_SRC_PATH)/arm/glue.S $(APPLE2_SRC_PATH)/arm/cpu.S
|
||||
|
||||
APPLE2_VIDEO_SRC = \
|
||||
$(APPLE2_SRC_PATH)/video/glvideo.c \
|
||||
$(APPLE2_SRC_PATH)/video/gltouchjoy.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/matrixUtil.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/modelUtil.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/sourceUtil.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/vectorUtil.c
|
||||
|
||||
APPLE2_AUDIO_SRC = \
|
||||
$(APPLE2_SRC_PATH)/audio/soundcore.c $(APPLE2_SRC_PATH)/audio/soundcore-openal.c $(APPLE2_SRC_PATH)/audio/speaker.c \
|
||||
$(APPLE2_SRC_PATH)/audio/win-shim.c $(APPLE2_SRC_PATH)/audio/alhelpers.c $(APPLE2_SRC_PATH)/audio/mockingboard.c \
|
||||
$(APPLE2_SRC_PATH)/audio/AY8910.c
|
||||
|
||||
APPLE2_META_SRC = \
|
||||
$(APPLE2_SRC_PATH)/meta/debug.c $(APPLE2_SRC_PATH)/meta/debugger.c $(APPLE2_SRC_PATH)/meta/opcodes.c
|
||||
|
||||
APPLE2_MAIN_SRC = \
|
||||
$(APPLE2_SRC_PATH)/font.c $(APPLE2_SRC_PATH)/rom.c $(APPLE2_SRC_PATH)/misc.c $(APPLE2_SRC_PATH)/display.c $(APPLE2_SRC_PATH)/vm.c \
|
||||
$(APPLE2_SRC_PATH)/timing.c $(APPLE2_SRC_PATH)/zlib-helpers.c $(APPLE2_SRC_PATH)/joystick.c $(APPLE2_SRC_PATH)/keys.c \
|
||||
$(APPLE2_SRC_PATH)/disk.c $(APPLE2_SRC_PATH)/cpu-supp.c
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Build flags
|
||||
|
||||
APPLE2_BASE_CFLAGS = -DPACKAGE_NAME="\"$(PACKAGE_NAME)\"" -DCONFIG_DATADIR="\"/data/data/$(PACKAGE_IDENTIFIER)\"" -std=gnu11 -I$(APPLE2_SRC_PATH)
|
||||
APPLE2_CFLAGS := $(APPLE2_BASE_CFLAGS) -DHEADLESS=0 -DAPPLE2IX=1 -DVIDEO_OPENGL=1 -DDEBUGGER=1 -DHAVE_OPENSSL=0
|
||||
|
||||
TESTCPU_CFLAGS := $(APPLE2_BASE_CFLAGS) -DHEADLESS=1 -DAPPLE2IX=1 -DVIDEO_OPENGL=0 -DDEBUGGER=1 -DHAVE_OPENSSL=0
|
||||
TESTVM_CLFAGS :=
|
||||
TESTDISK_CLFAGS :=
|
||||
TESTDISPLAY_CLFAGS :=
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Android build config
|
||||
|
||||
LOCAL_MODULE := apple2ix
|
||||
LOCAL_SRC_FILES := jnihooks.c
|
||||
LOCAL_CFLAGS := $(APPLE2_CFLAGS)
|
||||
LOCAL_LDLIBS := -llog -landroid -lGLESv2 -lz
|
||||
|
||||
# Add assembly files first ... mostly for the benefit of the ARM assembler ...
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
LOCAL_SRC_FILES += $(APPLE2_X86_SRC)
|
||||
else
|
||||
LOCAL_SRC_FILES += $(APPLE2_ARM_SRC)
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES += $(APPLE2_MAIN_SRC) $(APPLE2_META_SRC) $(APPLE2_VIDEO_SRC)
|
||||
|
||||
# Build a shared library and let Java/Dalvik drive
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
# --OR-- Build an executable so native can drive this show
|
||||
#include $(BUILD_EXECUTABLE)
|
||||
|
32
Android/jni/apple2ix.mk
Normal file
32
Android/jni/apple2ix.mk
Normal file
@ -0,0 +1,32 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
PACKAGE_IDENTIFIER := "org.deadc0de.apple2"
|
||||
PACKAGE_NAME := "apple2ix"
|
||||
COMMON_SOURCES_MK := sources.mk
|
||||
include $(COMMON_SOURCES_MK)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Android build config
|
||||
|
||||
LOCAL_MODULE := apple2ix
|
||||
LOCAL_SRC_FILES := jnihooks.c
|
||||
LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS) -DHEADLESS=0 -DVIDEO_OPENGL=1 -DDEBUGGER=0 -DHAVE_OPENSSL=0
|
||||
LOCAL_LDLIBS := -llog -landroid -lGLESv2 -lz
|
||||
|
||||
# Add assembly files first ... mostly for the benefit of the ARM assembler ...
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
LOCAL_SRC_FILES += $(APPLE2_X86_SRC)
|
||||
else
|
||||
LOCAL_SRC_FILES += $(APPLE2_ARM_SRC)
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES += $(APPLE2_MAIN_SRC) $(APPLE2_META_SRC) $(APPLE2_VIDEO_SRC)
|
||||
|
||||
# Build a shared library and let Java/Dalvik drive
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
# --OR-- Build an executable so native can drive this show
|
||||
#include $(BUILD_EXECUTABLE)
|
||||
|
@ -10,7 +10,27 @@ if test "$(basename $0)" = "clean" ; then
|
||||
/bin/rm $apple2_src_path/font.c
|
||||
/bin/rm $apple2_src_path/x86/glue.S
|
||||
/bin/rm $apple2_src_path/arm/glue.S
|
||||
ndk-build clean
|
||||
|
||||
ln -s apple2ix.mk Android.mk
|
||||
ndk-build -f apple2ix.mk clean
|
||||
/bin/rm Android.mk
|
||||
|
||||
ln -s testcpu.mk Android.mk
|
||||
ndk-build -f testcpu.mk clean
|
||||
/bin/rm Android.mk
|
||||
|
||||
ln -s testvm.mk Android.mk
|
||||
ndk-build -f testvm.mk clean
|
||||
/bin/rm Android.mk
|
||||
|
||||
ln -s testdisplay.mk Android.mk
|
||||
ndk-build -f testdisplay.mk clean
|
||||
/bin/rm Android.mk
|
||||
|
||||
ln -s testdisk.mk Android.mk
|
||||
ndk-build -f testdisk.m clean
|
||||
/bin/rm Android.mk
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -30,10 +50,25 @@ $CC $CFLAGS -o $apple2_src_path/genfont $apple2_src_path/genfont.c && \
|
||||
$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 V=1 NDK_DEBUG=1 && ant -f ../build.xml
|
||||
if test "$(basename $0)" = "testcpu" ; then
|
||||
ln -s testcpu.mk Android.mk
|
||||
ndk-build V=1 NDK_DEBUG=1 && ant -f ../build.xml debug
|
||||
elif test "$(basename $0)" = "testvm" ; then
|
||||
ln -s testvm.mk Android.mk
|
||||
ndk-build V=1 NDK_DEBUG=1 && ant -f ../build.xml debug
|
||||
elif test "$(basename $0)" = "testdisplay" ; then
|
||||
ln -s testdisplay.mk Android.mk
|
||||
ndk-build V=1 NDK_DEBUG=1 && ant -f ../build.xml debug
|
||||
elif test "$(basename $0)" = "testdisk" ; then
|
||||
ln -s testdisk.mk Android.mk
|
||||
ndk-build V=1 NDK_DEBUG=1 && ant -f ../build.xml debug
|
||||
else
|
||||
ln -s apple2ix.mk Android.mk
|
||||
ndk-build V=1 NDK_DEBUG=1 && ant -f ../build.xml debug
|
||||
fi
|
||||
|
||||
if test "$(basename $0)" = "run" ; then
|
||||
ant -f ../build.xml debug install && \
|
||||
ant -f ../build.xml install && \
|
||||
adb shell am start -a android.intent.action.MAIN -n org.deadc0de.apple2/.Apple2Activity
|
||||
fi
|
||||
|
||||
@ -41,5 +76,7 @@ if test "$(basename $0)" = "debug" ; then
|
||||
echo "TODO FIXME ..."
|
||||
fi
|
||||
|
||||
/bin/rm Android.mk
|
||||
|
||||
set +x
|
||||
|
||||
|
34
Android/jni/sources.mk
Normal file
34
Android/jni/sources.mk
Normal file
@ -0,0 +1,34 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# Common emulator sources and build settings
|
||||
|
||||
APPLE2_SRC_PATH := ../../src
|
||||
|
||||
APPLE2_X86_SRC := \
|
||||
$(APPLE2_SRC_PATH)/x86/glue.S $(APPLE2_SRC_PATH)/x86/cpu.S
|
||||
|
||||
APPLE2_ARM_SRC := \
|
||||
$(APPLE2_SRC_PATH)/arm/glue.S $(APPLE2_SRC_PATH)/arm/cpu.S
|
||||
|
||||
APPLE2_VIDEO_SRC = \
|
||||
$(APPLE2_SRC_PATH)/video/glvideo.c \
|
||||
$(APPLE2_SRC_PATH)/video/gltouchjoy.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/matrixUtil.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/modelUtil.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/sourceUtil.c \
|
||||
$(APPLE2_SRC_PATH)/video_util/vectorUtil.c
|
||||
|
||||
APPLE2_AUDIO_SRC = \
|
||||
$(APPLE2_SRC_PATH)/audio/soundcore.c $(APPLE2_SRC_PATH)/audio/soundcore-openal.c $(APPLE2_SRC_PATH)/audio/speaker.c \
|
||||
$(APPLE2_SRC_PATH)/audio/win-shim.c $(APPLE2_SRC_PATH)/audio/alhelpers.c $(APPLE2_SRC_PATH)/audio/mockingboard.c \
|
||||
$(APPLE2_SRC_PATH)/audio/AY8910.c
|
||||
|
||||
APPLE2_META_SRC = \
|
||||
$(APPLE2_SRC_PATH)/meta/debug.c $(APPLE2_SRC_PATH)/meta/debugger.c $(APPLE2_SRC_PATH)/meta/opcodes.c
|
||||
|
||||
APPLE2_MAIN_SRC = \
|
||||
$(APPLE2_SRC_PATH)/font.c $(APPLE2_SRC_PATH)/rom.c $(APPLE2_SRC_PATH)/misc.c $(APPLE2_SRC_PATH)/display.c $(APPLE2_SRC_PATH)/vm.c \
|
||||
$(APPLE2_SRC_PATH)/timing.c $(APPLE2_SRC_PATH)/zlib-helpers.c $(APPLE2_SRC_PATH)/joystick.c $(APPLE2_SRC_PATH)/keys.c \
|
||||
$(APPLE2_SRC_PATH)/disk.c $(APPLE2_SRC_PATH)/cpu-supp.c
|
||||
|
||||
APPLE2_BASE_CFLAGS := -DAPPLE2IX=1 -DPACKAGE_NAME="\"$(PACKAGE_NAME)\"" -DCONFIG_DATADIR="\"/data/data/$(PACKAGE_IDENTIFIER)\"" -std=gnu11 -I$(APPLE2_SRC_PATH)
|
||||
|
1
Android/jni/testcpu
Symbolic link
1
Android/jni/testcpu
Symbolic link
@ -0,0 +1 @@
|
||||
build.sh
|
32
Android/jni/testcpu.mk
Normal file
32
Android/jni/testcpu.mk
Normal file
@ -0,0 +1,32 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
PACKAGE_IDENTIFIER := "org.deadc0de.apple2"
|
||||
PACKAGE_NAME := "apple2ix"
|
||||
COMMON_SOURCES_MK := sources.mk
|
||||
include $(COMMON_SOURCES_MK)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Android build config
|
||||
|
||||
LOCAL_MODULE := apple2ix
|
||||
LOCAL_SRC_FILES := $(APPLE2_SRC_PATH)/test/testcommon.c $(APPLE2_SRC_PATH)/test/testcpu.c
|
||||
LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS) -DHEADLESS=1 -DDEBUGGER=1 -DHAVE_OPENSSL=0
|
||||
LOCAL_LDLIBS := -llog -landroid -lGLESv2 -lz
|
||||
|
||||
# Add assembly files first ... mostly for the benefit of the ARM assembler ...
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
LOCAL_SRC_FILES += $(APPLE2_X86_SRC)
|
||||
else
|
||||
LOCAL_SRC_FILES += $(APPLE2_ARM_SRC)
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES += $(APPLE2_MAIN_SRC) $(APPLE2_META_SRC)
|
||||
|
||||
# Build a shared library and let Java/Dalvik drive
|
||||
#include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
# --OR-- Build an executable so native can drive this show
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user