1 LOCAL_PATH := $(call my-dir)
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_))
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
19 SOURCES_C := $(CORE_DIR)/cdriso.c \
23 $(CORE_DIR)/decode_xa.c \
24 $(CORE_DIR)/disr3000a.c \
27 $(CORE_DIR)/plugins.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 \
35 $(CORE_DIR)/psxinterpreter.c \
36 $(CORE_DIR)/psxmem.c \
37 $(CORE_DIR)/r3000a.c \
39 $(CORE_DIR)/socket.c \
42 $(CORE_DIR)/gte_nf.c \
43 $(CORE_DIR)/gte_divider.c
46 SOURCES_C += $(SPU_DIR)/dma.c \
48 $(SPU_DIR)/registers.c \
54 SOURCES_C += $(GPU_DIR)/gpu.c \
58 SOURCES_C += $(CDR_DIR)/cdrcimg.c
61 SOURCES_C += $(INPUT_DIR)/main.c \
66 SOURCES_C += $(FRONTEND_DIR)/main.c \
67 $(FRONTEND_DIR)/plugin.c \
68 $(FRONTEND_DIR)/cspace.c \
69 $(FRONTEND_DIR)/libretro.c
72 SOURCES_C += $(DYNAREC_DIR)/backends/psx/emu_if.c
74 COREFLAGS := -ffast-math -funroll-loops -DHAVE_LIBRETRO -DNO_FRONTEND -DFRONTEND_SUPPORTS_RGB565 -DANDROID -DREARMED
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
83 COREFLAGS += -DDRC_DISABLE
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
98 SOURCES_C += $(UNAI_DIR)/gpulib_if.cpp
101 GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
102 ifneq ($(GIT_VERSION)," unknown")
103 COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
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
115 ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
116 LOCAL_ARM_NEON := true
118 ifeq ($(TARGET_ARCH),arm)
119 LOCAL_LDLIBS += -Wl,-no-warn-shared-textrel
122 include $(BUILD_SHARED_LIBRARY)