Commit | Line | Data |
---|---|---|
b2058a5b TK |
1 | LOCAL_PATH := $(call my-dir) |
2 | ||
77668f25 AK |
3 | $(shell cd "$(LOCAL_PATH)" && ((git describe || echo) | sed -e 's/.*/#define REV "\0"/' > ../frontend/revision.h_)) |
4 | $(shell cd "$(LOCAL_PATH)" && (diff -q ../frontend/revision.h_ ../frontend/revision.h > /dev/null 2>&1 || cp ../frontend/revision.h_ ../frontend/revision.h)) | |
5 | $(shell cd "$(LOCAL_PATH)" && (rm ../frontend/revision.h_)) | |
b2058a5b | 6 | |
77668f25 AK |
7 | ROOT_DIR := $(LOCAL_PATH)/.. |
8 | CORE_DIR := $(ROOT_DIR)/libpcsxcore | |
9 | SPU_DIR := $(ROOT_DIR)/plugins/dfsound | |
10 | GPU_DIR := $(ROOT_DIR)/plugins/gpulib | |
11 | CDR_DIR := $(ROOT_DIR)/plugins/cdrcimg | |
12 | INPUT_DIR := $(ROOT_DIR)/plugins/dfinput | |
13 | FRONTEND_DIR := $(ROOT_DIR)/frontend | |
14 | NEON_DIR := $(ROOT_DIR)/plugins/gpu_neon | |
15 | UNAI_DIR := $(ROOT_DIR)/plugins/gpu_unai | |
16 | DYNAREC_DIR := $(ROOT_DIR)/libpcsxcore/new_dynarec | |
17 | ||
18 | # core | |
19 | SOURCES_C := $(CORE_DIR)/cdriso.c \ | |
20 | $(CORE_DIR)/cdrom.c \ | |
21 | $(CORE_DIR)/cheat.c \ | |
22 | $(CORE_DIR)/debug.c \ | |
23 | $(CORE_DIR)/decode_xa.c \ | |
24 | $(CORE_DIR)/disr3000a.c \ | |
25 | $(CORE_DIR)/mdec.c \ | |
26 | $(CORE_DIR)/misc.c \ | |
27 | $(CORE_DIR)/plugins.c \ | |
28 | $(CORE_DIR)/ppf.c \ | |
29 | $(CORE_DIR)/psxbios.c \ | |
30 | $(CORE_DIR)/psxcommon.c \ | |
31 | $(CORE_DIR)/psxcounters.c \ | |
32 | $(CORE_DIR)/psxdma.c \ | |
33 | $(CORE_DIR)/psxhle.c \ | |
34 | $(CORE_DIR)/psxhw.c \ | |
35 | $(CORE_DIR)/psxinterpreter.c \ | |
36 | $(CORE_DIR)/psxmem.c \ | |
37 | $(CORE_DIR)/r3000a.c \ | |
38 | $(CORE_DIR)/sio.c \ | |
39 | $(CORE_DIR)/socket.c \ | |
40 | $(CORE_DIR)/spu.c \ | |
41 | $(CORE_DIR)/gte.c \ | |
42 | $(CORE_DIR)/gte_nf.c \ | |
43 | $(CORE_DIR)/gte_divider.c | |
b2058a5b | 44 | |
77668f25 AK |
45 | # spu |
46 | SOURCES_C += $(SPU_DIR)/dma.c \ | |
47 | $(SPU_DIR)/freeze.c \ | |
48 | $(SPU_DIR)/registers.c \ | |
49 | $(SPU_DIR)/spu.c \ | |
50 | $(SPU_DIR)/out.c \ | |
51 | $(SPU_DIR)/nullsnd.c | |
b2058a5b | 52 | |
77668f25 AK |
53 | # gpu |
54 | SOURCES_C += $(GPU_DIR)/gpu.c \ | |
55 | $(GPU_DIR)/vout_pl.c | |
b2058a5b | 56 | |
77668f25 AK |
57 | # cdrcimg |
58 | SOURCES_C += $(CDR_DIR)/cdrcimg.c | |
b2058a5b | 59 | |
77668f25 AK |
60 | # dfinput |
61 | SOURCES_C += $(INPUT_DIR)/main.c \ | |
62 | $(INPUT_DIR)/pad.c \ | |
63 | $(INPUT_DIR)/guncon.c | |
b2058a5b | 64 | |
77668f25 AK |
65 | # frontend |
66 | SOURCES_C += $(FRONTEND_DIR)/main.c \ | |
67 | $(FRONTEND_DIR)/plugin.c \ | |
68 | $(FRONTEND_DIR)/cspace.c \ | |
69 | $(FRONTEND_DIR)/libretro.c | |
b2058a5b | 70 | |
77668f25 AK |
71 | # dynarec |
72 | SOURCES_C += $(DYNAREC_DIR)/backends/psx/emu_if.c | |
c82f907a | 73 | |
661e95f6 | 74 | COREFLAGS := -ffast-math -funroll-loops -DHAVE_LIBRETRO -DNO_FRONTEND -DFRONTEND_SUPPORTS_RGB565 -DANDROID -DREARMED |
b2058a5b | 75 | |
77668f25 AK |
76 | ifeq ($(TARGET_ARCH),arm) |
77 | SOURCES_ASM := $(CORE_DIR)/gte_arm.S \ | |
78 | $(SPU_DIR)/arm_utils.S \ | |
79 | $(DYNAREC_DIR)/arm/linkage_arm.S | |
80 | SOURCES_C += $(DYNAREC_DIR)/new_dynarec.c \ | |
81 | $(DYNAREC_DIR)/backends/psx/pcsxmem.c | |
82 | else | |
83 | COREFLAGS += -DDRC_DISABLE | |
84 | SOURCES_ASM := | |
b2058a5b TK |
85 | endif |
86 | ||
77668f25 AK |
87 | ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) |
88 | COREFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP | |
89 | SOURCES_ASM += $(CORE_DIR)/gte_neon.S \ | |
90 | $(NEON_DIR)/psx_gpu/psx_gpu_arm_neon.S \ | |
91 | $(FRONTEND_DIR)/cspace_neon.S | |
92 | SOURCES_C += $(NEON_DIR)/psx_gpu_if.c | |
93 | else ifeq ($(TARGET_ARCH_ABI),armeabi) | |
94 | SOURCES_ASM += $(UNAI_DIR)/gpu_arm.s \ | |
95 | $(FRONTEND_DIR)/cspace_arm.S | |
96 | SOURCES_C += $(UNAI_DIR)/gpulib_if.cpp | |
97 | else | |
98 | SOURCES_C += $(UNAI_DIR)/gpulib_if.cpp | |
b2058a5b TK |
99 | endif |
100 | ||
77668f25 AK |
101 | GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" |
102 | ifneq ($(GIT_VERSION)," unknown") | |
103 | COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" | |
b2058a5b TK |
104 | endif |
105 | ||
77668f25 AK |
106 | include $(CLEAR_VARS) |
107 | LOCAL_MODULE := retro | |
108 | LOCAL_SRC_FILES := $(SOURCES_C) $(SOURCES_ASM) | |
109 | LOCAL_CFLAGS := $(COREFLAGS) | |
110 | LOCAL_C_INCLUDES := $(ROOT_DIR)/include | |
111 | LOCAL_LDFLAGS := -Wl,-version-script=$(FRONTEND_DIR)/link.T | |
112 | LOCAL_LDLIBS := -lz -llog | |
113 | LOCAL_ARM_MODE := arm | |
114 | ||
115 | ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) | |
116 | LOCAL_ARM_NEON := true | |
117 | endif | |
118 | ifeq ($(TARGET_ARCH),arm) | |
119 | LOCAL_LDLIBS += -Wl,-no-warn-shared-textrel | |
b2058a5b | 120 | endif |
b2058a5b TK |
121 | |
122 | include $(BUILD_SHARED_LIBRARY) |