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