| Commit | Line | Data |
|---|---|---|
| 4132e8ca | 1 | # Makefile for PCSX ReARMed |
| a80ae4a0 | 2 | |
| 61bc6d40 | 3 | # default stuff goes here, so that config can override |
| 9aff1963 | 4 | TARGET ?= pcsx |
| 41846131 | 5 | CFLAGS += -Wall -Iinclude -ffast-math |
| 6 | ||
| 7 | DEBUG ?= 0 | |
| 8 | DEBUG_SYMS ?= 0 | |
| 9 | ASSERTS ?= 0 | |
| 10 | HAVE_CHD ?= 1 | |
| 11 | ifneq ($(DEBUG)$(DEBUG_SYMS), 00) | |
| 12 | CFLAGS += -ggdb | |
| 13 | endif | |
| 14 | ifneq ($(DEBUG), 1) | |
| 15284c51 | 15 | CFLAGS += -O3 |
| 79c4d434 | 16 | ifneq ($(ASSERTS), 1) |
| fad9f755 | 17 | CFLAGS += -DNDEBUG |
| 18 | endif | |
| b60f2812 | 19 | endif |
| 36c76c86 PC |
20 | ifeq ($(DEBUG_ASAN), 1) |
| 21 | CFLAGS += -fsanitize=address | |
| 5dd884df | 22 | LDFLAGS += -fsanitize=address |
| 23 | #LDFLAGS += -static-libasan | |
| 36c76c86 | 24 | endif |
| 597571ad | 25 | ifeq ($(DEBUG_UBSAN), 1) |
| 26 | CFLAGS += -fsanitize=undefined -fno-sanitize=shift-base | |
| 27 | LDFLAGS += -fsanitize=undefined | |
| 28 | endif | |
| 4132e8ca | 29 | #DRC_DBG = 1 |
| 30 | #PCNT = 1 | |
| 80c2304e | 31 | |
| a4c71501 | 32 | # Suppress minor warnings for dependencies |
| 33 | deps/%: CFLAGS += -Wno-unused -Wno-unused-function | |
| 34 | ||
| 38c2028e | 35 | all: config.mak target_ plugins_ |
| de38f20e | 36 | |
| 9aff1963 | 37 | ifndef NO_CONFIG_MAK |
| 4132e8ca | 38 | ifneq ($(wildcard config.mak),) |
| 39 | config.mak: ./configure | |
| 40 | @echo $@ is out-of-date, running configure | |
| 41 | @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh | |
| 42 | include config.mak | |
| 43 | else | |
| 44 | config.mak: | |
| 45 | @echo "Please run ./configure before running make!" | |
| 46 | @exit 1 | |
| 47 | endif | |
| 9aff1963 | 48 | else # NO_CONFIG_MAK |
| 49 | config.mak: | |
| 50 | endif | |
| 51 | ||
| 4132e8ca | 52 | -include Makefile.local |
| 80c2304e | 53 | |
| 9aff1963 | 54 | CC_LINK ?= $(CC) |
| 55 | CC_AS ?= $(CC) | |
| 22fa3f2b | 56 | LDFLAGS += $(MAIN_LDFLAGS) |
| f49a4c48 | 57 | #EXTRA_LDFLAGS ?= -Wl,-Map=$@.map # not on some linkers |
| 07c13dfd | 58 | LDLIBS += $(MAIN_LDLIBS) |
| e0aec5ee | 59 | ifdef PCNT |
| 60 | CFLAGS += -DPCNT | |
| 61 | endif | |
| 61bc6d40 | 62 | |
| f49a4c48 | 63 | ifneq ($(NO_FSECTIONS), 1) |
| 64 | CFLAGS += -ffunction-sections -fdata-sections | |
| 65 | ifeq ($(GNU_LINKER),1) | |
| 66 | FSECTIONS_LDFLAGS ?= -Wl,--gc-sections | |
| 67 | LDFLAGS += $(FSECTIONS_LDFLAGS) | |
| 68 | endif | |
| 69 | endif # NO_FSECTIONS | |
| 70 | CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \ | |
| 71 | -DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \ | |
| 72 | -DP_HAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1) \ | |
| 73 | -DDISABLE_MEM_LUTS=0 | |
| 74 | CXXFLAGS += $(CFLAGS) | |
| 75 | ||
| 80c2304e | 76 | # core |
| 08d9d257 | 77 | OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cdrom-async.o \ |
| 78 | libpcsxcore/cheat.o libpcsxcore/database.o \ | |
| 7d7672a5 | 79 | libpcsxcore/decode_xa.o libpcsxcore/mdec.o \ |
| 80c2304e | 80 | libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \ |
| 0890ae15 | 81 | libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o \ |
| 9a0a61d2 | 82 | libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o \ |
| 83 | libpcsxcore/psxevents.o libpcsxcore/r3000a.o \ | |
| abf09485 | 84 | libpcsxcore/sio.o libpcsxcore/spu.o libpcsxcore/gpu.o |
| 59774ed0 | 85 | OBJS += libpcsxcore/gte.o libpcsxcore/gte_nf.o libpcsxcore/gte_divider.o |
| 7d7672a5 | 86 | #OBJS += libpcsxcore/debug.o libpcsxcore/socket.o libpcsxcore/disr3000a.o |
| 79c4d434 | 87 | |
| 88 | ifeq ($(WANT_ZLIB),1) | |
| 89 | ZLIB_DIR = deps/libchdr/deps/zlib-1.3.1 | |
| 90 | CFLAGS += -I$(ZLIB_DIR) | |
| 91 | OBJS += $(ZLIB_DIR)/adler32.o \ | |
| 92 | $(ZLIB_DIR)/compress.o \ | |
| 93 | $(ZLIB_DIR)/crc32.o \ | |
| 94 | $(ZLIB_DIR)/deflate.o \ | |
| 95 | $(ZLIB_DIR)/gzclose.o \ | |
| 96 | $(ZLIB_DIR)/gzlib.o \ | |
| 97 | $(ZLIB_DIR)/gzread.o \ | |
| 98 | $(ZLIB_DIR)/gzwrite.o \ | |
| 99 | $(ZLIB_DIR)/infback.o \ | |
| 100 | $(ZLIB_DIR)/inffast.o \ | |
| 101 | $(ZLIB_DIR)/inflate.o \ | |
| 102 | $(ZLIB_DIR)/inftrees.o \ | |
| 103 | $(ZLIB_DIR)/trees.o \ | |
| 104 | $(ZLIB_DIR)/uncompr.o \ | |
| 105 | $(ZLIB_DIR)/zutil.o | |
| 106 | $(ZLIB_DIR)/%.o: CFLAGS += -DHAVE_UNISTD_H | |
| 107 | endif | |
| 108 | ||
| 59774ed0 | 109 | ifeq "$(ARCH)" "arm" |
| 110 | OBJS += libpcsxcore/gte_arm.o | |
| 111 | endif | |
| 57467c77 | 112 | ifeq "$(HAVE_NEON_ASM)" "1" |
| 8cfbda97 | 113 | OBJS += libpcsxcore/gte_neon.o |
| 114 | endif | |
| 305c8c93 | 115 | libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull |
| ab948f7e | 116 | |
| 9c0bfd96 | 117 | ifeq ($(MMAP_WIN32),1) |
| 118 | CFLAGS += -Iinclude/mman -Ideps/mman | |
| 119 | OBJS += deps/mman/mman.o | |
| 120 | endif | |
| fad9f755 | 121 | ifeq "$(USE_ASYNC_CDROM)" "1" |
| 122 | libpcsxcore/cdrom-async.o: CFLAGS += -DUSE_ASYNC_CDROM | |
| 123 | frontend/libretro.o: CFLAGS += -DUSE_ASYNC_CDROM | |
| 124 | frontend/menu.o: CFLAGS += -DUSE_ASYNC_CDROM | |
| 125 | USE_RTHREADS := 1 | |
| 126 | endif | |
| 127 | ||
| f95a77f7 | 128 | # dynarec |
| a4c71501 | 129 | ifeq "$(DYNAREC)" "lightrec" |
| 130 | CFLAGS += -Ideps/lightning/include -Ideps/lightrec -Iinclude/lightning -Iinclude/lightrec \ | |
| 131 | -DLIGHTREC -DLIGHTREC_STATIC | |
| 97fa754e PC |
132 | ifeq ($(LIGHTREC_DEBUG),1) |
| 133 | deps/lightrec/%.o: CFLAGS += -DLOG_LEVEL=DEBUG_L | |
| 134 | libpcsxcore/lightrec/plugin.o: CFLAGS += -DLIGHTREC_DEBUG=1 | |
| 135 | frontend/main.o: CFLAGS += -DLIGHTREC_DEBUG=1 | |
| 136 | deps/lightning/%.o: CFLAGS += -DDISASSEMBLER=1 -DBINUTILS_2_38=1 -DBINUTILS_2_29=1 \ | |
| 137 | -DHAVE_DISASSEMBLE_INIT_FOR_TARGET=1 -DPACKAGE_VERSION=1 | |
| 138 | LDFLAGS += -lopcodes -lbfd | |
| 139 | endif | |
| a4c71501 | 140 | LIGHTREC_CUSTOM_MAP ?= 0 |
| 141 | LIGHTREC_CUSTOM_MAP_OBJ ?= libpcsxcore/lightrec/mem.o | |
| 142 | LIGHTREC_THREADED_COMPILER ?= 0 | |
| 143 | LIGHTREC_CODE_INV ?= 0 | |
| 144 | CFLAGS += -DLIGHTREC_CUSTOM_MAP=$(LIGHTREC_CUSTOM_MAP) \ | |
| 145 | -DLIGHTREC_CODE_INV=$(LIGHTREC_CODE_INV) \ | |
| 97fa754e | 146 | -DLIGHTREC_ENABLE_THREADED_COMPILER=$(LIGHTREC_THREADED_COMPILER) \ |
| 746146ba PC |
147 | -DLIGHTREC_ENABLE_DISASSEMBLER=$(or $(LIGHTREC_DEBUG),0) \ |
| 148 | -DLIGHTREC_NO_DEBUG=$(if $(LIGHTREC_DEBUG),0,1) | |
| a4c71501 | 149 | ifeq ($(LIGHTREC_CUSTOM_MAP),1) |
| 150 | LDLIBS += -lrt | |
| 151 | OBJS += $(LIGHTREC_CUSTOM_MAP_OBJ) | |
| 152 | endif | |
| 153 | ifeq ($(NEED_SYSCONF),1) | |
| 154 | OBJS += libpcsxcore/lightrec/sysconf.o | |
| 155 | endif | |
| 156 | ifeq ($(LIGHTREC_THREADED_COMPILER),1) | |
| 157 | OBJS += deps/lightrec/recompiler.o \ | |
| 158 | deps/lightrec/reaper.o | |
| 159 | endif | |
| 160 | OBJS += deps/lightrec/tlsf/tlsf.o | |
| 161 | OBJS += libpcsxcore/lightrec/plugin.o | |
| 162 | OBJS += deps/lightning/lib/jit_disasm.o \ | |
| 163 | deps/lightning/lib/jit_memory.o \ | |
| 164 | deps/lightning/lib/jit_names.o \ | |
| 165 | deps/lightning/lib/jit_note.o \ | |
| 166 | deps/lightning/lib/jit_print.o \ | |
| 167 | deps/lightning/lib/jit_size.o \ | |
| 168 | deps/lightning/lib/lightning.o \ | |
| 169 | deps/lightrec/blockcache.o \ | |
| 170 | deps/lightrec/constprop.o \ | |
| 171 | deps/lightrec/disassembler.o \ | |
| 172 | deps/lightrec/emitter.o \ | |
| 173 | deps/lightrec/interpreter.o \ | |
| 174 | deps/lightrec/lightrec.o \ | |
| 175 | deps/lightrec/memmanager.o \ | |
| 176 | deps/lightrec/optimizer.o \ | |
| 177 | deps/lightrec/regcache.o | |
| 178 | deps/lightning/%.o: CFLAGS += -DHAVE_MMAP=P_HAVE_MMAP | |
| 179 | deps/lightning/%: CFLAGS += -Wno-uninitialized | |
| 180 | deps/lightrec/%: CFLAGS += -Wno-uninitialized | |
| 181 | libpcsxcore/lightrec/mem.o: CFLAGS += -D_GNU_SOURCE | |
| 182 | ifeq ($(MMAP_WIN32),1) | |
| 9c0bfd96 | 183 | deps/lightning/lib/lightning.o: CFLAGS += -Dmprotect=_mprotect # deps/mman |
| 184 | deps/lightning/lib/jit_print.o: CFLAGS += -w | |
| a4c71501 | 185 | endif |
| 186 | else ifeq "$(DYNAREC)" "ari64" | |
| be516ebe | 187 | OBJS += libpcsxcore/new_dynarec/new_dynarec.o |
| 7e605697 | 188 | OBJS += libpcsxcore/new_dynarec/pcsxmem.o |
| be516ebe | 189 | ifeq "$(ARCH)" "arm" |
| 190 | OBJS += libpcsxcore/new_dynarec/linkage_arm.o | |
| 687b4580 | 191 | libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c |
| 57467c77 | 192 | else ifneq (,$(findstring $(ARCH),aarch64 arm64)) |
| be516ebe | 193 | OBJS += libpcsxcore/new_dynarec/linkage_arm64.o |
| 687b4580 | 194 | libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm64.c |
| be516ebe | 195 | else |
| 196 | $(error no dynarec support for architecture $(ARCH)) | |
| 197 | endif | |
| 0b1633d7 | 198 | ifeq "$(NDRC_THREAD)" "1" |
| 199 | libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -DNDRC_THREAD | |
| 200 | libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -DNDRC_THREAD | |
| 201 | frontend/libretro.o: CFLAGS += -DNDRC_THREAD | |
| 202 | USE_RTHREADS := 1 | |
| 203 | endif | |
| 448bbcae | 204 | else |
| 41e82ad4 | 205 | CFLAGS += -DDRC_DISABLE |
| 7139f3c8 | 206 | endif |
| 9a0a61d2 | 207 | OBJS += libpcsxcore/new_dynarec/emu_if.o |
| 687b4580 | 208 | libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/pcsxmem_inline.c |
| 3eb78778 | 209 | ifdef DRC_DBG |
| 210 | libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64 | |
| 211 | CFLAGS += -DDRC_DBG | |
| 212 | endif | |
| 2a014d73 | 213 | ifeq "$(BASE_ADDR_DYNAMIC)" "1" |
| 214 | libpcsxcore/new_dynarec/%.o: CFLAGS += -DBASE_ADDR_DYNAMIC=1 | |
| a327ad27 | 215 | endif |
| f95a77f7 | 216 | |
| e906c010 | 217 | # spu |
| ee849648 | 218 | OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \ |
| 07c13dfd | 219 | plugins/dfsound/registers.o plugins/dfsound/spu.o \ |
| 220 | plugins/dfsound/out.o plugins/dfsound/nullsnd.o | |
| 6d866bb7 | 221 | plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \ |
| 222 | plugins/dfsound/xa.c | |
| 3a721c1f | 223 | ifeq "$(ARCH)" "arm" |
| b17618c0 | 224 | OBJS += plugins/dfsound/arm_utils.o |
| 225 | endif | |
| 5514a050 | 226 | ifeq "$(HAVE_C64_TOOLS)" "1" |
| 42dde520 | 227 | plugins/dfsound/%.o: CFLAGS += -DC64X_DSP -DWANT_THREAD_CODE |
| 5514a050 | 228 | plugins/dfsound/spu.o: plugins/dfsound/spu_c64x.c |
| 8886a808 | 229 | frontend/menu.o: CFLAGS += -DC64X_DSP |
| 5514a050 | 230 | endif |
| 07c13dfd | 231 | ifneq ($(findstring oss,$(SOUND_DRIVERS)),) |
| 232 | plugins/dfsound/out.o: CFLAGS += -DHAVE_OSS | |
| de38f20e | 233 | OBJS += plugins/dfsound/oss.o |
| 234 | endif | |
| 07c13dfd | 235 | ifneq ($(findstring alsa,$(SOUND_DRIVERS)),) |
| 236 | plugins/dfsound/out.o: CFLAGS += -DHAVE_ALSA | |
| de38f20e | 237 | OBJS += plugins/dfsound/alsa.o |
| 4132e8ca | 238 | LDLIBS += -lasound |
| 239 | endif | |
| 07c13dfd | 240 | ifneq ($(findstring sdl,$(SOUND_DRIVERS)),) |
| 241 | plugins/dfsound/out.o: CFLAGS += -DHAVE_SDL | |
| d8a2f79b | 242 | OBJS += plugins/dfsound/sdl.o |
| 243 | endif | |
| 07c13dfd | 244 | ifneq ($(findstring pulseaudio,$(SOUND_DRIVERS)),) |
| 245 | plugins/dfsound/out.o: CFLAGS += -DHAVE_PULSE | |
| 246 | OBJS += plugins/dfsound/pulseaudio.o | |
| 247 | endif | |
| 248 | ifneq ($(findstring libretro,$(SOUND_DRIVERS)),) | |
| 249 | plugins/dfsound/out.o: CFLAGS += -DHAVE_LIBRETRO | |
| de38f20e | 250 | endif |
| 251 | ||
| 5368e5b9 A |
252 | # supported gpu list in menu |
| 253 | ifeq "$(HAVE_NEON_GPU)" "1" | |
| 254 | frontend/menu.o: CFLAGS += -DGPU_NEON | |
| 255 | endif | |
| 256 | ifeq "$(HAVE_GLES)" "1" | |
| 257 | frontend/menu.o: CFLAGS += -DHAVE_GLES | |
| 258 | endif | |
| 259 | ||
| 61bc6d40 | 260 | # builtin gpu |
| f060f4be | 261 | OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o plugins/gpulib/prim.o |
| 61bc6d40 | 262 | ifeq "$(BUILTIN_GPU)" "neon" |
| 79c4d434 | 263 | CFLAGS += -DGPU_NEON |
| 57467c77 | 264 | OBJS += plugins/gpu_neon/psx_gpu_if.o |
| 90ca4913 | 265 | plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP |
| 266 | plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c | |
| 57467c77 | 267 | frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_NEON |
| 268 | ifeq "$(HAVE_NEON_ASM)" "1" | |
| 269 | OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o | |
| 270 | else | |
| 271 | OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_simd.o | |
| 272 | plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DSIMD_BUILD | |
| 273 | plugins/gpu_neon/psx_gpu/psx_gpu_simd.o: CFLAGS += -DSIMD_BUILD | |
| 274 | endif | |
| 61bc6d40 | 275 | endif |
| 276 | ifeq "$(BUILTIN_GPU)" "peops" | |
| 79c4d434 | 277 | CFLAGS += -DGPU_PEOPS |
| 2ef486ee | 278 | # note: code is not safe for strict-aliasing? (Castlevania problems) |
| 62d7fa95 | 279 | plugins/dfxvideo/gpulib_if.o: CFLAGS += -fno-strict-aliasing |
| 280 | plugins/dfxvideo/gpulib_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c | |
| f2ba1d45 | 281 | frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_PEOPS |
| 62d7fa95 | 282 | OBJS += plugins/dfxvideo/gpulib_if.o |
| 79c4d434 | 283 | ifeq "$(THREAD_RENDERING)" "1" |
| 284 | CFLAGS += -DTHREAD_RENDERING | |
| 285 | OBJS += plugins/gpulib/gpulib_thread_if.o | |
| 286 | endif | |
| 90ca4913 | 287 | endif |
| e0c692d9 | 288 | |
| 4cfc568d | 289 | ifeq "$(BUILTIN_GPU)" "unai" |
| 79c4d434 | 290 | CFLAGS += -DGPU_UNAI |
| 291 | CFLAGS += -DUSE_GPULIB=1 | |
| 4cfc568d | 292 | OBJS += plugins/gpu_unai/gpulib_if.o |
| 0bfe8d59 | 293 | ifeq "$(ARCH)" "arm" |
| 4cfc568d | 294 | OBJS += plugins/gpu_unai/gpu_arm.o |
| 0bfe8d59 | 295 | endif |
| 5ddc3a7a | 296 | ifeq "$(THREAD_RENDERING)" "1" |
| 297 | CFLAGS += -DTHREAD_RENDERING | |
| 298 | OBJS += plugins/gpulib/gpulib_thread_if.o | |
| 299 | endif | |
| 300 | ifneq "$(GPU_UNAI_NO_OLD)" "1" | |
| 301 | OBJS += plugins/gpu_unai/old/if.o | |
| 302 | else | |
| 303 | CFLAGS += -DGPU_UNAI_NO_OLD | |
| 304 | endif | |
| 8177857b | 305 | plugins/gpu_unai/gpulib_if.o: plugins/gpu_unai/*.h |
| 5ddc3a7a | 306 | plugins/gpu_unai/gpulib_if.o: CFLAGS += -DREARMED -DUSE_GPULIB=1 |
| f2ba1d45 | 307 | frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_UNAI |
| 6aa72faf | 308 | ifneq ($(DEBUG), 1) |
| 5ddc3a7a | 309 | plugins/gpu_unai/gpulib_if.o \ |
| 310 | plugins/gpu_unai/old/if.o: CFLAGS += -O3 | |
| 6aa72faf | 311 | endif |
| 0bfe8d59 | 312 | CC_LINK = $(CXX) |
| 313 | endif | |
| 314 | ||
| a51adab4 | 315 | # libchdr |
| 79c4d434 | 316 | ifeq "$(HAVE_CHD)" "1" |
| 58126d96 | 317 | LCHDR = deps/libchdr |
| 8c065899 | 318 | LCHDR_LZMA = $(LCHDR)/deps/lzma-24.05 |
| 319 | LCHDR_ZSTD = $(LCHDR)/deps/zstd-1.5.6/lib | |
| 58126d96 | 320 | OBJS += $(LCHDR)/src/libchdr_bitstream.o |
| 321 | OBJS += $(LCHDR)/src/libchdr_cdrom.o | |
| 322 | OBJS += $(LCHDR)/src/libchdr_chd.o | |
| 323 | OBJS += $(LCHDR)/src/libchdr_flac.o | |
| 324 | OBJS += $(LCHDR)/src/libchdr_huffman.o | |
| ded8498a | 325 | $(LCHDR)/src/%.o: CFLAGS += -Wno-unused -Wno-maybe-uninitialized -std=gnu11 |
| 58126d96 | 326 | OBJS += $(LCHDR_LZMA)/src/Alloc.o |
| 58126d96 | 327 | OBJS += $(LCHDR_LZMA)/src/CpuArch.o |
| 328 | OBJS += $(LCHDR_LZMA)/src/Delta.o | |
| 329 | OBJS += $(LCHDR_LZMA)/src/LzFind.o | |
| 58126d96 | 330 | OBJS += $(LCHDR_LZMA)/src/LzmaDec.o |
| 331 | OBJS += $(LCHDR_LZMA)/src/LzmaEnc.o | |
| 332 | OBJS += $(LCHDR_LZMA)/src/Sort.o | |
| 8c065899 | 333 | $(LCHDR_LZMA)/src/%.o: CFLAGS += -Wno-unused -DZ7_ST -I$(LCHDR_LZMA)/include |
| 58126d96 | 334 | $(LCHDR)/src/%.o: CFLAGS += -I$(LCHDR_LZMA)/include |
| 58126d96 | 335 | OBJS += $(LCHDR_ZSTD)/common/entropy_common.o |
| 336 | OBJS += $(LCHDR_ZSTD)/common/error_private.o | |
| 337 | OBJS += $(LCHDR_ZSTD)/common/fse_decompress.o | |
| 58126d96 | 338 | OBJS += $(LCHDR_ZSTD)/common/xxhash.o |
| 339 | OBJS += $(LCHDR_ZSTD)/common/zstd_common.o | |
| 340 | OBJS += $(LCHDR_ZSTD)/decompress/huf_decompress.o | |
| 8c065899 | 341 | OBJS += $(LCHDR_ZSTD)/decompress/huf_decompress_amd64.o |
| 58126d96 | 342 | OBJS += $(LCHDR_ZSTD)/decompress/zstd_ddict.o |
| 343 | OBJS += $(LCHDR_ZSTD)/decompress/zstd_decompress_block.o | |
| 344 | OBJS += $(LCHDR_ZSTD)/decompress/zstd_decompress.o | |
| 345 | $(LCHDR_ZSTD)/common/%.o \ | |
| 8c065899 | 346 | $(LCHDR_ZSTD)/decompress/%.o: CFLAGS += -I$(LCHDR_ZSTD) |
| 58126d96 | 347 | $(LCHDR)/src/%.o: CFLAGS += -I$(LCHDR_ZSTD) |
| 68e7d409 | 348 | libpcsxcore/cdriso.o: CFLAGS += -Wno-unused-function |
| 58126d96 | 349 | CFLAGS += -DHAVE_CHD -I$(LCHDR)/include |
| 79c4d434 | 350 | endif |
| e906c010 | 351 | |
| cc56203b | 352 | # frontend/gui |
| c82f907a | 353 | OBJS += frontend/cspace.o |
| 57467c77 | 354 | ifeq "$(HAVE_NEON_ASM)" "1" |
| c82f907a | 355 | OBJS += frontend/cspace_neon.o |
| 9b592b3f | 356 | frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565 -DHAVE_bgr888_to_x |
| d57557c0 | 357 | else |
| 358 | ifeq "$(ARCH)" "arm" | |
| 359 | OBJS += frontend/cspace_arm.o | |
| 57467c77 | 360 | frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565 |
| d57557c0 | 361 | endif |
| c82f907a | 362 | endif |
| 363 | ||
| 4132e8ca | 364 | ifeq "$(PLATFORM)" "generic" |
| 5b9aa749 | 365 | OBJS += frontend/libpicofe/in_sdl.o |
| 81023939 | 366 | #OBJS += frontend/libpicofe/plat_sdl.o |
| cc56203b | 367 | OBJS += frontend/libpicofe/plat_dummy.o |
| 5b9aa749 | 368 | OBJS += frontend/plat_sdl.o |
| 81023939 | 369 | frontend/plat_sdl.o frontend/libpicofe/plat_sdl.o: CFLAGS += -DSDL_OVERLAY_2X |
| 370 | frontend/menu.o: CFLAGS += -DSDL_OVERLAY_2X -DMENU_SHOW_VARSCALER=1 | |
| f49a4c48 | 371 | ifeq "$(HAVE_EVDEV)" "1" |
| 372 | OBJS += frontend/libpicofe/linux/in_evdev.o | |
| 373 | endif | |
| 5b9aa749 | 374 | ifeq "$(HAVE_GLES)" "1" |
| 2c616080 | 375 | OBJS += frontend/libpicofe/gl.o frontend/libpicofe/gl_platform.o |
| 86e02a02 | 376 | OBJS += frontend/libpicofe/gl_loader.o |
| 377 | #LDLIBS += $(LDLIBS_GLES) # loaded dynamically now | |
| 5b9aa749 | 378 | frontend/libpicofe/plat_sdl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) |
| 2c616080 | 379 | frontend/libpicofe/gl_platform.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) |
| 5b9aa749 | 380 | frontend/libpicofe/gl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) |
| 381 | frontend/plat_sdl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) | |
| 382 | endif | |
| cc56203b | 383 | USE_PLUGIN_LIB = 1 |
| 38c2028e | 384 | USE_FRONTEND = 1 |
| 4132e8ca | 385 | endif |
| 55b0eeea | 386 | ifeq "$(PLATFORM)" "pandora" |
| cc56203b | 387 | OBJS += frontend/libpicofe/pandora/plat.o |
| 388 | OBJS += frontend/libpicofe/linux/fbdev.o frontend/libpicofe/linux/xenv.o | |
| 389 | OBJS += frontend/libpicofe/linux/in_evdev.o | |
| 390 | OBJS += frontend/plat_pandora.o frontend/plat_omap.o | |
| da710571 | 391 | frontend/main.o frontend/menu.o: CFLAGS += -include frontend/pandora/ui_feat.h |
| 1ae743b1 | 392 | frontend/main.o frontend/plugin_lib.o: CFLAGS += -DPANDORA |
| 3aba4185 | 393 | frontend/libpicofe/linux/plat.o: CFLAGS += -DPANDORA |
| cc56203b | 394 | USE_PLUGIN_LIB = 1 |
| 38c2028e | 395 | USE_FRONTEND = 1 |
| fad9f755 | 396 | CFLAGS += -gdwarf-3 |
| 4132e8ca | 397 | endif |
| 55b0eeea | 398 | ifeq "$(PLATFORM)" "caanoo" |
| cc56203b | 399 | OBJS += frontend/libpicofe/gp2x/in_gp2x.o frontend/warm/warm.o |
| 400 | OBJS += frontend/libpicofe/gp2x/soc_pollux.o | |
| 401 | OBJS += frontend/libpicofe/linux/in_evdev.o | |
| faf2b2aa | 402 | OBJS += frontend/plat_pollux.o frontend/in_tsbutton.o frontend/blit320.o |
| da710571 | 403 | frontend/main.o frontend/menu.o: CFLAGS += -include frontend/320240/ui_gp2x.h |
| cc56203b | 404 | USE_PLUGIN_LIB = 1 |
| 38c2028e | 405 | USE_FRONTEND = 1 |
| 406 | endif | |
| 8cf3ffc7 A |
407 | ifeq "$(PLATFORM)" "miyoo" |
| 408 | HOMEPATH = /mnt | |
| 409 | OBJS += frontend/libpicofe/in_sdl.o | |
| 410 | OBJS += frontend/libpicofe/linux/in_evdev.o | |
| 411 | OBJS += frontend/libpicofe/plat_dummy.o | |
| 412 | OBJS += frontend/plat_sdl.o | |
| 413 | frontend/main.o frontend/menu.o: CFLAGS += -include frontend/320240/ui_miyoo.h | |
| 414 | USE_PLUGIN_LIB = 1 | |
| 415 | USE_FRONTEND = 1 | |
| 416 | endif | |
| 38c2028e | 417 | ifeq "$(PLATFORM)" "maemo" |
| baaef67b | 418 | OBJS += maemo/hildon.o maemo/main.o maemo/maemo_xkb.o frontend/pl_gun_ts.o |
| 38c2028e | 419 | maemo/%.o: maemo/%.c |
| cc56203b | 420 | USE_PLUGIN_LIB = 1 |
| a76fd953 | 421 | LDFLAGS += $(shell pkg-config --libs hildon-1 libpulse) |
| 7010034e | 422 | CFLAGS += $(shell pkg-config --cflags hildon-1) -DHAVE_TSLIB |
| a76fd953 PI |
423 | CFLAGS += `pkg-config --cflags glib-2.0 libosso dbus-1 hildon-fm-2` |
| 424 | LDFLAGS += `pkg-config --libs glib-2.0 libosso dbus-1 hildon-fm-2` | |
| 38c2028e | 425 | endif |
| 426 | ifeq "$(PLATFORM)" "libretro" | |
| 835c219c | 427 | ifneq "$(HAVE_PHYSICAL_CDROM)$(USE_LIBRETRO_VFS)" "00" |
| 428 | OBJS += deps/libretro-common/compat/compat_strl.o | |
| 429 | OBJS += deps/libretro-common/file/file_path.o | |
| 430 | OBJS += deps/libretro-common/string/stdstring.o | |
| 431 | OBJS += deps/libretro-common/vfs/vfs_implementation.o | |
| 432 | endif | |
| 433 | ifeq "$(HAVE_PHYSICAL_CDROM)" "1" | |
| e0216409 | 434 | OBJS += frontend/libretro-cdrom.o |
| 435 | OBJS += deps/libretro-common/lists/string_list.o | |
| 835c219c | 436 | OBJS += deps/libretro-common/memmap/memalign.o |
| 437 | OBJS += deps/libretro-common/vfs/vfs_implementation_cdrom.o | |
| 438 | CFLAGS += -DHAVE_CDROM | |
| 439 | endif | |
| 440 | ifeq "$(USE_LIBRETRO_VFS)" "1" | |
| 441 | OBJS += deps/libretro-common/compat/compat_posix_string.o | |
| 442 | OBJS += deps/libretro-common/compat/fopen_utf8.o | |
| 443 | OBJS += deps/libretro-common/encodings/encoding_utf.o | |
| 444 | OBJS += deps/libretro-common/streams/file_stream.o | |
| 445 | OBJS += deps/libretro-common/streams/file_stream_transforms.o | |
| 446 | OBJS += deps/libretro-common/time/rtime.o | |
| 447 | CFLAGS += -DUSE_LIBRETRO_VFS | |
| 448 | endif | |
| 38c2028e | 449 | OBJS += frontend/libretro.o |
| 0b1633d7 | 450 | CFLAGS += -DHAVE_LIBRETRO |
| 451 | INC_LIBRETRO_COMMON := 1 | |
| ce0e7ac9 | 452 | |
| 0b1633d7 | 453 | endif # $(PLATFORM) == "libretro" |
| 454 | ||
| 455 | ifeq "$(USE_RTHREADS)" "1" | |
| 456 | OBJS += frontend/libretro-rthreads.o | |
| 457 | OBJS += deps/libretro-common/features/features_cpu.o | |
| d135f6d2 | 458 | frontend/main.o: CFLAGS += -DHAVE_RTHREADS |
| 0b1633d7 | 459 | INC_LIBRETRO_COMMON := 1 |
| 460 | endif | |
| 461 | ifeq "$(INC_LIBRETRO_COMMON)" "1" | |
| 462 | CFLAGS += -Ideps/libretro-common/include | |
| a4c71501 | 463 | endif |
| cc56203b | 464 | |
| 465 | ifeq "$(USE_PLUGIN_LIB)" "1" | |
| 38c2028e | 466 | OBJS += frontend/plugin_lib.o |
| cc56203b | 467 | OBJS += frontend/libpicofe/linux/plat.o |
| 468 | OBJS += frontend/libpicofe/readpng.o frontend/libpicofe/fonts.o | |
| a4da039c | 469 | frontend/libpicofe/linux/plat.o: CFLAGS += -DNO_HOME_DIR |
| 57467c77 | 470 | ifeq "$(HAVE_NEON_ASM)" "1" |
| cc56203b | 471 | OBJS += frontend/libpicofe/arm/neon_scale2x.o |
| 472 | OBJS += frontend/libpicofe/arm/neon_eagle2x.o | |
| 473 | frontend/libpicofe/arm/neon_scale2x.o: CFLAGS += -DDO_BGR_TO_RGB | |
| 474 | frontend/libpicofe/arm/neon_eagle2x.o: CFLAGS += -DDO_BGR_TO_RGB | |
| 475 | endif | |
| 476 | endif | |
| 477 | ifeq "$(USE_FRONTEND)" "1" | |
| 478 | OBJS += frontend/menu.o | |
| 479 | OBJS += frontend/libpicofe/input.o | |
| b21c766f | 480 | frontend/libpicofe/input.o: CFLAGS += -Wno-array-bounds |
| cc56203b | 481 | frontend/menu.o: frontend/libpicofe/menu.c |
| 38c2028e | 482 | ifeq "$(HAVE_TSLIB)" "1" |
| 483 | frontend/%.o: CFLAGS += -DHAVE_TSLIB | |
| 484 | OBJS += frontend/pl_gun_ts.o | |
| 485 | endif | |
| 486 | else | |
| 487 | CFLAGS += -DNO_FRONTEND | |
| 55b0eeea | 488 | endif |
| a80ae4a0 | 489 | |
| cc56203b | 490 | # misc |
| 491 | OBJS += frontend/main.o frontend/plugin.o | |
| f906311d | 492 | frontend/main.o libpcsxcore/misc.o: CFLAGS += -DBUILTIN_GPU=$(BUILTIN_GPU) |
| e0aec5ee | 493 | |
| f906311d | 494 | frontend/menu.o frontend/main.o: include/revision.h |
| 495 | frontend/plat_sdl.o frontend/libretro.o: include/revision.h | |
| 496 | libpcsxcore/misc.o: include/revision.h | |
| 3c70c47b | 497 | |
| fad9f755 | 498 | CFLAGS += $(CFLAGS_LAST) |
| 499 | ||
| cc56203b | 500 | frontend/libpicofe/%.c: |
| fa56d360 | 501 | @echo "libpicofe module is missing, please run:" |
| 502 | @echo "git submodule init && git submodule update" | |
| 503 | @exit 1 | |
| 504 | ||
| 59774ed0 | 505 | libpcsxcore/gte_nf.o: libpcsxcore/gte.c |
| 506 | $(CC) -c -o $@ $^ $(CFLAGS) -DFLAGLESS | |
| 507 | ||
| f906311d | 508 | include/revision.h: FORCE |
| 4527b1fd | 509 | @(git describe --always || echo) | sed -e 's/.*/#define REV "\0"/' > $@_ |
| 3c70c47b | 510 | @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@ |
| 511 | @rm $@_ | |
| 3c70c47b | 512 | |
| 90ca4913 | 513 | %.o: %.S |
| 9aff1963 | 514 | $(CC_AS) $(CFLAGS) -c $^ -o $@ |
| 80c2304e | 515 | |
| e0aec5ee | 516 | |
| 38c2028e | 517 | target_: $(TARGET) |
| 518 | ||
| 80c2304e | 519 | $(TARGET): $(OBJS) |
| 20a25fd7 | 520 | ifeq ($(PARTIAL_LINKING), 1) |
| a7a6db33 | 521 | $(LD) -o $(basename $(TARGET))1.o -r --gc-sections $(addprefix -u ,$(shell cat frontend/libretro-extern)) $(addprefix -u ,$(EXTRA_EXTERN_SYMS)) $^ |
| 522 | $(OBJCOPY) --keep-global-symbols=frontend/libretro-extern $(addprefix -G ,$(EXTRA_EXTERN_SYMS)) $(basename $(TARGET))1.o $(basename $(TARGET)).o | |
| 20a25fd7 | 523 | $(AR) rcs $@ $(basename $(TARGET)).o |
| 524 | else ifeq ($(STATIC_LINKING), 1) | |
| 525 | $(AR) rcs $@ $^ | |
| 526 | else | |
| 07f64ac7 | 527 | $(CC_LINK) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS) |
| 20a25fd7 | 528 | endif |
| 80c2304e | 529 | |
| dd4d5a35 | 530 | clean: $(PLAT_CLEAN) clean_plugins |
| f906311d | 531 | $(RM) $(TARGET) *.o $(OBJS) $(TARGET).map include/revision.h |
| 0d464c77 | 532 | |
| 4132e8ca | 533 | ifneq ($(PLUGINS),) |
| dd4d5a35 | 534 | plugins_: $(PLUGINS) |
| 535 | ||
| ddab6158 | 536 | plugins/gpulib/gpulib.$(ARCH).a: |
| 537 | $(MAKE) -C plugins/gpulib/ | |
| 538 | ||
| 539 | $(PLUGINS): plugins/gpulib/gpulib.$(ARCH).a | |
| 4cccc4d2 | 540 | $(MAKE) -C $(dir $@) |
| f932e54b | 541 | |
| ee78346e | 542 | clean_plugins: |
| 4cccc4d2 | 543 | $(MAKE) -C plugins/gpulib/ clean |
| ee78346e | 544 | for dir in $(PLUGINS) ; do \ |
| 545 | $(MAKE) -C $$(dirname $$dir) clean; done | |
| dd4d5a35 | 546 | else |
| 547 | plugins_: | |
| 548 | clean_plugins: | |
| 4132e8ca | 549 | endif |
| 80c2304e | 550 | |
| fa56d360 | 551 | .PHONY: all clean target_ plugins_ clean_plugins FORCE |
| 552 | ||
| 857275a9 | 553 | ifneq "$(PLATFORM)" "pandora" |
| 554 | ifdef CPATH | |
| 555 | $(warning warning: CPATH is defined) | |
| 556 | endif | |
| 557 | endif | |
| 558 | ||
| 303ee308 | 559 | # ----------- release ----------- |
| 560 | ||
| 4527b1fd | 561 | VER ?= $(shell git describe --always HEAD) |
| 4132e8ca | 562 | |
| dd4d5a35 | 563 | ifeq "$(PLATFORM)" "generic" |
| 564 | OUT = pcsx_rearmed_$(VER) | |
| 565 | ||
| 566 | rel: pcsx $(PLUGINS) \ | |
| 567 | frontend/pandora/skin readme.txt COPYING | |
| 568 | rm -rf $(OUT) | |
| 569 | mkdir -p $(OUT)/plugins | |
| 570 | mkdir -p $(OUT)/bios | |
| 571 | cp -r $^ $(OUT)/ | |
| 2eda4524 | 572 | -mv $(OUT)/*.so* $(OUT)/plugins/ |
| dd4d5a35 | 573 | zip -9 -r $(OUT).zip $(OUT) |
| 574 | endif | |
| 575 | ||
| 4132e8ca | 576 | ifeq "$(PLATFORM)" "pandora" |
| 303ee308 | 577 | PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh |
| 578 | ||
| 8886a808 | 579 | rel: pcsx plugins/dfsound/pcsxr_spu_area3.out $(PLUGINS) \ |
| 9e0630ab | 580 | frontend/pandora/pcsx.sh frontend/pandora/pcsx.pxml.templ frontend/pandora/pcsx.png \ |
| 581 | frontend/pandora/picorestore frontend/pandora/skin readme.txt COPYING | |
| 303ee308 | 582 | rm -rf out |
| bbd837c6 | 583 | mkdir -p out/plugins |
| 303ee308 | 584 | cp -r $^ out/ |
| 3938f69a | 585 | sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml |
| 586 | rm out/pcsx.pxml.templ | |
| 2eda4524 | 587 | -mv out/*.so out/plugins/ |
| 9e0630ab | 588 | $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i frontend/pandora/pcsx.png -c |
| 4132e8ca | 589 | endif |
| 590 | ||
| 8cf3ffc7 A |
591 | ifeq "$(PLATFORM)" "miyoo" |
| 592 | ||
| 593 | rel: pcsx $(PLUGINS) \ | |
| 594 | frontend/320240/pcsx26.png \ | |
| 595 | frontend/320240/skin \ | |
| 596 | readme.txt COPYING | |
| 597 | rm -rf out | |
| 598 | mkdir -p out/pcsx_rearmed/plugins | |
| 599 | cp -r $^ out/pcsx_rearmed/ | |
| 600 | -mv out/pcsx_rearmed/*.so out/pcsx_rearmed/plugins/ | |
| 601 | mkdir out/pcsx_rearmed/lib/ | |
| 602 | mkdir out/pcsx_rearmed/bios/ | |
| 603 | cd out && zip -9 -r ../pcsx_rearmed_$(VER)_miyoo.zip * | |
| 458ddcc5 A |
604 | |
| 605 | ipk: rel | |
| 606 | VERSION="$(VER)" gm2xpkg -q -f miyoo/pkg.cfg | |
| 607 | mv pcsx.ipk pcsx_rearmed.ipk | |
| 8cf3ffc7 A |
608 | endif |
| 609 | ||
| 4132e8ca | 610 | ifeq "$(PLATFORM)" "caanoo" |
| 611 | PLAT_CLEAN = caanoo_clean | |
| 612 | ||
| 613 | caanoo_clean: | |
| 614 | $(RM) frontend/320240/pollux_set | |
| 615 | ||
| 4132e8ca | 616 | rel: pcsx $(PLUGINS) \ |
| 617 | frontend/320240/caanoo.gpe frontend/320240/pcsx26.png \ | |
| 618 | frontend/320240/pcsxb.png frontend/320240/skin \ | |
| 619 | frontend/warm/bin/warm_2.6.24.ko frontend/320240/pollux_set \ | |
| 620 | frontend/320240/pcsx_rearmed.ini frontend/320240/haptic_w.cfg \ | |
| 621 | frontend/320240/haptic_s.cfg \ | |
| 622 | readme.txt COPYING | |
| 623 | rm -rf out | |
| 624 | mkdir -p out/pcsx_rearmed/plugins | |
| 625 | cp -r $^ out/pcsx_rearmed/ | |
| 2eda4524 | 626 | -mv out/pcsx_rearmed/*.so out/pcsx_rearmed/plugins/ |
| 4132e8ca | 627 | mv out/pcsx_rearmed/caanoo.gpe out/pcsx_rearmed/pcsx.gpe |
| 628 | mv out/pcsx_rearmed/pcsx_rearmed.ini out/ | |
| 629 | mkdir out/pcsx_rearmed/lib/ | |
| 630 | cp ./lib/libbz2.so.1 out/pcsx_rearmed/lib/ | |
| 631 | mkdir out/pcsx_rearmed/bios/ | |
| 632 | cd out && zip -9 -r ../pcsx_rearmed_$(VER)_caanoo.zip * | |
| 633 | endif |