This is litterally all that was required to build on Solaris 11. Portability FTW.
[pcsx_rearmed.git] / jni / Android.mk
CommitLineData
b2058a5b
TK
1LOCAL_PATH := $(call my-dir)
2
3include $(CLEAR_VARS)
4
8fc5171a
GR
5GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
6ifneq ($(GIT_VERSION)," unknown")
7 LOCAL_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
8endif
9
b2058a5b
TK
10APP_DIR := ../../src
11
829ebbca 12#fix stupid change in ndk r11 that breaks compiling even when the exe would run fine
13LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
14
b2058a5b
TK
15ifneq ($(TARGET_ARCH_ABI),armeabi-v7a)
16 NO_NEON_BUILD := 1
17else
18 NO_NEON_BUILD := $(NO_NEON)
19endif
20
21ifeq ($(NO_NEON_BUILD)$(TARGET_ARCH_ABI),1armeabi-v7a)
22 LOCAL_MODULE := retro-noneon
23else
24 LOCAL_MODULE := retro
25endif
26
27ifeq ($(TARGET_ARCH),arm)
28 LOCAL_ARM_MODE := arm
29
b2058a5b
TK
30 LOCAL_CFLAGS += -DANDROID_ARM
31
32 LOCAL_SRC_FILES += ../libpcsxcore/gte_arm.S
33
34 # dynarec
6f173b35 35 LOCAL_SRC_FILES += ../libpcsxcore/new_dynarec/new_dynarec.c ../libpcsxcore/new_dynarec/arm/linkage_arm.S ../libpcsxcore/new_dynarec/backends/psx/emu_if.c ../libpcsxcore/new_dynarec/backends/psx/pcsxmem.c
b2058a5b
TK
36
37 # spu
38 LOCAL_SRC_FILES += ../plugins/dfsound/arm_utils.S
39
c82f907a 40 # misc
41
b2058a5b
TK
42 ifeq ($(NO_NEON_BUILD),1)
43 # gpu
44 LOCAL_CFLAGS += -DREARMED
c82f907a 45 LOCAL_SRC_FILES += ../plugins/gpu_unai/gpulib_if.cpp ../plugins/gpu_unai/gpu_arm.s
d57557c0 46 LOCAL_SRC_FILES += ../frontend/cspace_arm.S
b2058a5b
TK
47 else
48 LOCAL_ARM_NEON := true
49 LOCAL_CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
8ac2c35b 50 LOCAL_SRC_FILES += ../libpcsxcore/gte_neon.S ../frontend/cspace_neon.S
b2058a5b
TK
51
52 # gpu
53 LOCAL_SRC_FILES += ../plugins/gpu_neon/psx_gpu_if.c ../plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
54 endif
55endif
56
57ifeq ($(TARGET_ARCH),x86)
58 LOCAL_CFLAGS += -DANDROID_X86
59endif
60
61ifeq ($(TARGET_ARCH),mips)
62 LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__
63endif
64
65ifneq ($(TARGET_ARCH),arm)
66 # gpu
67 LOCAL_CFLAGS += -DREARMED
c82f907a 68 LOCAL_SRC_FILES += ../plugins/gpu_unai/gpulib_if.cpp
b2058a5b
TK
69endif
70
71$(shell cd "$(LOCAL_PATH)" && ((git describe || echo) | sed -e 's/.*/#define REV "\0"/' > ../frontend/revision.h_))
72$(shell cd "$(LOCAL_PATH)" && (diff -q ../frontend/revision.h_ ../frontend/revision.h > /dev/null 2>&1 || cp ../frontend/revision.h_ ../frontend/revision.h))
73$(shell cd "$(LOCAL_PATH)" && (rm ../frontend/revision.h_))
74
75LOCAL_SRC_FILES += ../libpcsxcore/cdriso.c ../libpcsxcore/cdrom.c ../libpcsxcore/cheat.c ../libpcsxcore/debug.c \
76 ../libpcsxcore/decode_xa.c ../libpcsxcore/disr3000a.c ../libpcsxcore/mdec.c \
77 ../libpcsxcore/misc.c ../libpcsxcore/plugins.c ../libpcsxcore/ppf.c ../libpcsxcore/psxbios.c \
78 ../libpcsxcore/psxcommon.c ../libpcsxcore/psxcounters.c ../libpcsxcore/psxdma.c ../libpcsxcore/psxhle.c \
79 ../libpcsxcore/psxhw.c ../libpcsxcore/psxinterpreter.c ../libpcsxcore/psxmem.c ../libpcsxcore/r3000a.c \
80 ../libpcsxcore/sio.c ../libpcsxcore/socket.c ../libpcsxcore/spu.c
81LOCAL_SRC_FILES += ../libpcsxcore/gte.c ../libpcsxcore/gte_nf.c ../libpcsxcore/gte_divider.c
82
83# spu
84LOCAL_SRC_FILES += ../plugins/dfsound/dma.c ../plugins/dfsound/freeze.c \
85 ../plugins/dfsound/registers.c ../plugins/dfsound/spu.c \
86 ../plugins/dfsound/out.c ../plugins/dfsound/nullsnd.c
87
88# builtin gpu
89LOCAL_SRC_FILES += ../plugins/gpulib/gpu.c ../plugins/gpulib/vout_pl.c
90
91# cdrcimg
92LOCAL_SRC_FILES += ../plugins/cdrcimg/cdrcimg.c
93
94# dfinput
95LOCAL_SRC_FILES += ../plugins/dfinput/main.c ../plugins/dfinput/pad.c ../plugins/dfinput/guncon.c
96
a1a232ad 97# misc
c82f907a 98LOCAL_SRC_FILES += ../frontend/main.c ../frontend/plugin.c ../frontend/cspace.c
b2058a5b
TK
99
100# libretro
101LOCAL_SRC_FILES += ../frontend/libretro.c
102
f02594f5 103LOCAL_CFLAGS += -O3 -ffast-math -funroll-loops -DNDEBUG -D_FILE_OFFSET_BITS=64 -DHAVE_LIBRETRO -DNO_FRONTEND -DFRONTEND_SUPPORTS_RGB565 -DANDROID
da710571 104LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include
b2058a5b
TK
105LOCAL_LDLIBS := -lz -llog
106
107include $(BUILD_SHARED_LIBRARY)