android: solve "text segment is not shareable"
[picodrive.git] / jni / Android.mk
1 LOCAL_PATH := $(call my-dir)
2
3 include $(CLEAR_VARS)
4
5 GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
6 ifneq ($(GIT_VERSION)," unknown")
7         LOCAL_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
8 endif
9
10 #fix stupid change in ndk r11 that breaks compiling even when the exe would run fine
11 LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
12
13 LOCAL_MODULE := retro
14
15 R := ../
16 FR := $(LOCAL_PATH)/$(R)
17
18 use_cyclone = 0
19 use_fame = 0
20 use_musashi = 0
21 use_drz80 = 0
22 use_cz80 = 0
23 use_sh2drc = 0
24 use_sh2mame = 0
25 use_svpdrc = 0
26
27 asm_memory = 0
28 asm_render = 0
29 asm_ym2612 = 0
30 asm_misc = 0
31 asm_cdmemory = 0
32 asm_mix = 0
33
34 ifeq ($(TARGET_ARCH),arm)
35   LOCAL_ARM_MODE := arm
36   ifeq ($(NEON_BUILD),1)
37     LOCAL_ARM_NEON := true
38   endif
39
40   use_cyclone = 1
41
42   # texrels, -perf ~~8%
43   use_drz80 = 0
44   use_cz80 = 1
45
46   use_sh2drc = 1
47   use_svpdrc = 1
48
49 #  asm_memory = 1 # texrels, -perf negligible
50   asm_render = 1
51 #  asm_ym2612 = 1 # texrels, -perf ~~4%
52   asm_misc = 1
53 #  asm_cdmemory = 1 # texrels
54   asm_mix = 1
55 else
56   use_fame = 1
57   use_cz80 = 1
58   use_sh2mame = 1
59 endif
60
61 # PD is currently not strict aliasing safe
62 LOCAL_CFLAGS += -fno-strict-aliasing
63
64 # sources
65 SRCS_COMMON :=
66 DEFINES :=
67 ARCH := $(TARGET_ARCH)
68 include $(R)platform/common/common.mak
69
70 LOCAL_SRC_FILES += $(SRCS_COMMON)
71 LOCAL_SRC_FILES += $(R)platform/libretro/libretro.c
72 LOCAL_SRC_FILES += $(R)platform/common/mp3.c
73 LOCAL_SRC_FILES += $(R)platform/common/mp3_dummy.c
74
75 # zlib/unzip
76 LOCAL_SRC_FILES += $(R)zlib/gzio.c $(R)zlib/inffast.c $(R)zlib/inflate.c \
77         $(R)zlib/inftrees.c $(R)zlib/trees.c $(R)zlib/deflate.c \
78         $(R)zlib/crc32.c $(R)zlib/adler32.c $(R)zlib/zutil.c \
79         $(R)zlib/compress.c $(R)zlib/uncompr.c
80
81 LOCAL_SRC_FILES += $(R)unzip/unzip.c $(R)unzip/unzip_stream.c
82
83 LOCAL_C_INCLUDES += $(R)
84
85 # note: don't use -O3, causes some NDKs run out of memory while compiling FAME
86 LOCAL_CFLAGS += -Wall -O2 -ffast-math -DNDEBUG -DINLINE=inline
87 LOCAL_CFLAGS += $(addprefix -D,$(DEFINES))
88 LOCAL_LDLIBS := -llog
89
90 include $(BUILD_SHARED_LIBRARY)