smsplus-gx/Makefile.common
2020-10-09 08:52:26 +08:00

72 lines
2.3 KiB
Makefile

SOURCE_DIR := $(CORE_DIR)/source
LIBRETRO_COMMON := $(SOURCE_DIR)/ports/libretro/libretro-common
SOURCES_CXX :=
SOURCES_C :=
INCFLAGS += -I$(SOURCE_DIR)/ports/libretro -I$(LIBRETRO_COMMON)/include
INCFLAGS += -I$(SOURCE_DIR) -I$(SOURCE_DIR)/cpu_cores/$(Z80_CORE) -I$(SOURCE_DIR)/unzip
INCFLAGS += -I$(SOURCE_DIR)/sound -I$(SOURCE_DIR)/sound/$(SOUND_ENGINE) -I$(SOURCE_DIR)/sound_output
FLAGS += -DALIGN_DWORD -DLSB_FIRST -std=gnu99
ifeq ($(SOUND_ENGINE), crabemu_sn76489)
SOURCES_C += $(SOURCE_DIR)/sound/crabemu_sn76489/sn76489.c
else
CFLAGS += -DMAXIM_PSG
SOURCES_C += $(SOURCE_DIR)/sound/maxim_sn76489/sn76489.c
endif
ifeq ($(ZIP_SUPPORT), 0)
CFLAGS += -DNOZIP_SUPPORT
else
SOURCES_C += \
$(SOURCE_DIR)/unzip/fileio.c \
$(SOURCE_DIR)/unzip/ioapi.c \
$(SOURCE_DIR)/unzip/miniz.c \
$(SOURCE_DIR)/unzip/unzip.c
endif
# Main
SOURCES_C += \
$(SOURCE_DIR)/loadrom.c \
$(SOURCE_DIR)/memz80.c \
$(SOURCE_DIR)/pio.c \
$(SOURCE_DIR)/render.c \
$(SOURCE_DIR)/sms.c \
$(SOURCE_DIR)/state.c \
$(SOURCE_DIR)/system.c \
$(SOURCE_DIR)/tms.c \
$(SOURCE_DIR)/vdp.c
# CPU Cores
ifeq ($(Z80_CORE), eighty)
SOURCES_C += \
$(SOURCE_DIR)/cpu_cores/eighty/z80.c \
$(SOURCE_DIR)/cpu_cores/eighty/z80_ops.c \
$(SOURCE_DIR)/cpu_cores/eighty/z80_wrap.c
else
SOURCES_C += $(SOURCE_DIR)/cpu_cores/z80/z80.c
endif
# Sounds
SOURCES_C += \
$(SOURCE_DIR)/sound/fmintf.c \
$(SOURCE_DIR)/sound/sound.c \
$(SOURCE_DIR)/sound/ym2413.c
# SMS NTSC
INCFLAGS += -I$(SOURCE_DIR)/ntsc
SOURCES_C += $(SOURCE_DIR)/ntsc/sms_ntsc.c
# Libretro
ifeq ($(STATIC_LINKING),1)
else
SOURCES_C += $(LIBRETRO_COMMON)/streams/memory_stream.c
endif
SOURCES_C += \
$(SOURCE_DIR)/sound_output/libretro/sound_output_libretro.c \
$(SOURCE_DIR)/ports/libretro/libretro_state.c \
$(SOURCE_DIR)/ports/libretro/smsplus_libretro.c