Files
opera-libretro/Makefile.common
T
libretroadmin 85e45d084f Lock-free DSP thread on libretro-common; trim libretro-common
The threaded DSP takes no mutex or condition variable. The emulation
thread publishes a monotonic tick count with a release store and wakes
the DSP thread through a retro_eventcount once per 32 ticks and at
frame end; the DSP thread runs every posted tick and writes samples
into a retro_spsc ring that upload hands to the frontend in place.
Mode switches keep samples in order, and the thread runs out every
posted tick before it exits. THREADED_DSP defines HAVE_THREADS and
builds the eventcount and SPSC sources.

libretro-common is synced with RetroArch master and holds only the
sources the core builds and the headers they and the core include;
rstrtod.c is built since file_stream needs it.
2026-10-08 07:42:18 +02:00

164 lines
4.7 KiB
Makefile

ifeq ($(LIBRETRO_COMM_DIR),)
LIBRETRO_COMM_DIR := $(CORE_DIR)/libretro-common
endif
OPERA_DIR := $(CORE_DIR)/libopera
DEPS_DIR := $(CORE_DIR)/deps
INCFLAGS := \
-I$(CORE_DIR) \
-I$(CORE_DIR)/libopera \
-I$(LIBRETRO_COMM_DIR)/include \
-I$(DEPS_DIR)
ifneq (,$(findstring msvc2003,$(platform)))
INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
endif
SOURCES_C := \
$(CORE_DIR)/cuefile.c \
$(CORE_DIR)/libretro.c \
$(CORE_DIR)/libretro_core_options.c \
$(CORE_DIR)/opera_lr_nvram.c \
$(CORE_DIR)/opera_lr_callbacks.c \
$(CORE_DIR)/opera_lr_opts.c \
$(CORE_DIR)/opera_lr_dsp.c \
$(CORE_DIR)/lr_input.c \
$(CORE_DIR)/lr_input_crosshair.c \
$(CORE_DIR)/lr_input_descs.c \
$(CORE_DIR)/retro_cdimage.c
SOURCES_C += \
$(OPERA_DIR)/prng16.c \
$(OPERA_DIR)/prng32.c \
$(OPERA_DIR)/opera_3do.c \
$(OPERA_DIR)/opera_arm.c \
$(OPERA_DIR)/opera_bios.c \
$(OPERA_DIR)/opera_bitop.c \
$(OPERA_DIR)/opera_cdrom.c \
$(OPERA_DIR)/opera_clio.c \
$(OPERA_DIR)/opera_clock.c \
$(OPERA_DIR)/opera_diag_port.c \
$(OPERA_DIR)/opera_dsp.c \
$(OPERA_DIR)/opera_fixedpoint_math.c \
$(OPERA_DIR)/opera_log.c \
$(OPERA_DIR)/opera_madam.c \
$(OPERA_DIR)/opera_mem.c \
$(OPERA_DIR)/opera_nvram.c \
$(OPERA_DIR)/opera_pbus.c \
$(OPERA_DIR)/opera_region.c \
$(OPERA_DIR)/opera_sport.c \
$(OPERA_DIR)/opera_state.c \
$(OPERA_DIR)/opera_vdlp.c \
$(OPERA_DIR)/opera_xbus.c \
$(OPERA_DIR)/opera_xbus_cdrom_plugin.c
ifeq ($(HAVE_LIBNX), 1)
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/streams/interface_stream.c
endif
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \
$(LIBRETRO_COMM_DIR)/streams/memory_stream.c \
$(LIBRETRO_COMM_DIR)/streams/interface_stream.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.c \
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/memmap/memmap.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/string/rstrtod.c \
$(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
$(LIBRETRO_COMM_DIR)/file/retro_dirent.c \
$(LIBRETRO_COMM_DIR)/lists/dir_list.c \
$(LIBRETRO_COMM_DIR)/lists/string_list.c \
$(LIBRETRO_COMM_DIR)/memmap/memalign.c \
$(LIBRETRO_COMM_DIR)/time/rtime.c
ifeq ($(HAVE_CDROM), 1)
FLAGS += -DHAVE_CDROM
ifeq ($(CDROM_DEBUG), 1)
FLAGS += -DCDROM_DEBUG
endif
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/cdrom/cdrom.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_cdrom.c
endif
endif
FLAGS += -DHAVE_STDINT_H -DHAVE_STDLIB_H
ifeq (,$(findstring msvc,$(platform)))
FLAGS += -DHAVE_SYS_PARAM_H
FLAGS += -DINLINE="inline"
else
FLAGS += -DINLINE="_inline"
endif
ifeq ($(THREADED_DSP), 1)
FLAGS += -DTHREADED_DSP -DHAVE_THREADS
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c \
$(LIBRETRO_COMM_DIR)/rthreads/retro_eventcount.c \
$(LIBRETRO_COMM_DIR)/queues/retro_spsc.c
endif
endif
ifeq ($(HAVE_CHD), 1)
FLAGS += \
-DHAVE_CHD \
-DHAVE_RCHD \
-DHAVE_RCHD_DEFLATE \
-DHAVE_RCHD_LZMA \
-DHAVE_RCHD_FLAC \
-DHAVE_RCHD_ZSTD \
-DHAVE_RFLAC
INCFLAGS += \
-I$(DEPS_DIR)/zlib-1.3.1.2
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/streams/chd_stream.c \
$(LIBRETRO_COMM_DIR)/formats/chd/rchd.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_deflate.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_huffman.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_rzstd.c \
$(LIBRETRO_COMM_DIR)/formats/7z/r7z_lzma.c \
$(LIBRETRO_COMM_DIR)/formats/flac/rflac.c
ifeq ($(STATIC_LINKING), 1)
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.c \
$(LIBRETRO_COMM_DIR)/features/features_cpu.c
endif
endif
ZLIB_INCFLAGS = -I$(DEPS_DIR)/zlib-1.3.1.2
ZLIB_SOURCES_C = \
$(DEPS_DIR)/zlib-1.3.1.2/adler32.c \
$(DEPS_DIR)/zlib-1.3.1.2/crc32.c \
$(DEPS_DIR)/zlib-1.3.1.2/inffast.c \
$(DEPS_DIR)/zlib-1.3.1.2/inflate.c \
$(DEPS_DIR)/zlib-1.3.1.2/inftrees.c \
$(DEPS_DIR)/zlib-1.3.1.2/zutil.c
ifeq ($(SYSTEM_ZLIB), 1)
INCFLAGS += $(shell pkg-config --cflags zlib)
LIBS += $(shell pkg-config --libs zlib)
else
INCFLAGS += $(ZLIB_INCFLAGS)
SOURCES_C += $(ZLIB_SOURCES_C)
endif