2012-03-10 15:59:56 +00:00
|
|
|
DEBUG = 0
|
2012-12-14 20:31:55 +00:00
|
|
|
LIBRETRO_OPTIMIZATIONS = 1
|
|
|
|
FRONTEND_SUPPORTS_RGB565 = 1
|
2012-12-26 19:46:34 +00:00
|
|
|
HAVE_GRIFFIN = 0
|
2012-01-27 20:56:17 +00:00
|
|
|
|
|
|
|
ifeq ($(platform),)
|
|
|
|
platform = unix
|
|
|
|
ifeq ($(shell uname -a),)
|
|
|
|
platform = win
|
|
|
|
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
|
|
|
platform = osx
|
|
|
|
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
|
|
|
platform = win
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2012-12-14 20:31:55 +00:00
|
|
|
# system platform
|
|
|
|
system_platform = unix
|
|
|
|
ifeq ($(shell uname -a),)
|
|
|
|
system_platform = win
|
|
|
|
EXE_EXT=.exe
|
|
|
|
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
|
|
|
system_platform = osx
|
|
|
|
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
|
|
|
system_platform = win
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-03-10 15:59:56 +00:00
|
|
|
MAIN_FBA_DIR := src
|
|
|
|
FBA_BURN_DIR := $(MAIN_FBA_DIR)/burn
|
|
|
|
FBA_BURN_DRIVERS_DIR := $(MAIN_FBA_DIR)/burn/drv
|
|
|
|
FBA_BURNER_DIR := $(MAIN_FBA_DIR)/burner
|
2012-06-09 00:15:47 +00:00
|
|
|
LIBRETRO_DIR := $(FBA_BURNER_DIR)/libretro
|
2012-03-10 15:59:56 +00:00
|
|
|
FBA_CPU_DIR := $(MAIN_FBA_DIR)/cpu
|
|
|
|
FBA_LIB_DIR := $(MAIN_FBA_DIR)/dep/libs
|
|
|
|
FBA_INTERFACE_DIR := $(MAIN_FBA_DIR)/intf
|
2012-12-14 20:31:55 +00:00
|
|
|
FBA_GENERATED_DIR = $(MAIN_FBA_DIR)/dep/generated
|
|
|
|
FBA_SCRIPTS_DIR = $(MAIN_FBA_DIR)/dep/scripts
|
2012-12-26 19:46:34 +00:00
|
|
|
GRIFFIN_DIR = griffin-libretro
|
2012-03-10 15:59:56 +00:00
|
|
|
|
2012-04-01 18:58:41 +00:00
|
|
|
EXTERNAL_ZLIB = 0
|
|
|
|
|
2012-01-27 20:56:17 +00:00
|
|
|
ifeq ($(platform), unix)
|
2012-06-09 00:15:47 +00:00
|
|
|
TARGET := libretro.so
|
2012-01-27 20:56:17 +00:00
|
|
|
fpic := -fPIC
|
2012-06-09 00:15:47 +00:00
|
|
|
SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)/link.T
|
2012-01-27 20:56:17 +00:00
|
|
|
ENDIANNESS_DEFINES := -DLSB_FIRST
|
|
|
|
else ifeq ($(platform), osx)
|
2012-06-09 00:15:47 +00:00
|
|
|
TARGET := libretro.dylib
|
2012-01-27 20:56:17 +00:00
|
|
|
fpic := -fPIC
|
|
|
|
SHARED := -dynamiclib
|
|
|
|
ENDIANNESS_DEFINES := -DLSB_FIRST
|
|
|
|
else ifeq ($(platform), ps3)
|
2012-12-14 20:31:55 +00:00
|
|
|
TARGET := libretro_ps3.a
|
2012-04-01 18:58:41 +00:00
|
|
|
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
|
|
|
CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
|
|
|
|
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
|
|
|
|
ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN
|
2012-12-14 20:31:55 +00:00
|
|
|
PLATFORM_DEFINES += -D__CELLOS_LV2__
|
2012-04-01 18:58:41 +00:00
|
|
|
EXTERNAL_ZLIB = 1
|
|
|
|
else ifeq ($(platform), sncps3)
|
2012-12-14 20:31:55 +00:00
|
|
|
TARGET := libretro_ps3.a
|
2012-04-01 18:58:41 +00:00
|
|
|
CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
|
|
|
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
|
|
|
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
|
2012-01-27 20:56:17 +00:00
|
|
|
ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN
|
2012-04-01 18:58:41 +00:00
|
|
|
PLATFORM_DEFINES += -D__CELLOS_LV2__ -DSN_TARGET_PS3
|
|
|
|
EXTERNAL_ZLIB = 1
|
2012-12-14 20:31:55 +00:00
|
|
|
else ifeq ($(platform), psl1ght)
|
|
|
|
TARGET := libretro_psl1ght.a
|
|
|
|
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
|
|
|
|
CXX = $(PS3DEV)/ppu/bin/ppu-g++$(EXE_EXT)
|
|
|
|
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
|
|
|
|
ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN
|
|
|
|
PLATFORM_DEFINES += -D__CELLOS_LV2__
|
|
|
|
EXTERNAL_ZLIB = 1
|
2012-01-28 20:14:07 +00:00
|
|
|
else ifeq ($(platform), xenon)
|
2012-12-14 20:31:55 +00:00
|
|
|
TARGET := libretro_xenon360.a
|
|
|
|
CC = xenon-gcc$(EXE_EXT)
|
|
|
|
CXX = xenon-g++$(EXE_EXT)
|
|
|
|
AR = xenon-ar$(EXE_EXT)
|
2012-01-28 20:14:07 +00:00
|
|
|
ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN
|
|
|
|
PLATFORM_DEFINES := -D__LIBXENON__ -m32 -D__ppc__
|
2012-12-14 20:31:55 +00:00
|
|
|
else ifeq ($(platform), ngc)
|
|
|
|
TARGET := libretro_ngc.a
|
|
|
|
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
|
|
|
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
|
|
|
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
|
|
|
|
ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN
|
|
|
|
PLATFORM_DEFINES := -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float
|
|
|
|
EXTERNAL_ZLIB = 1
|
2012-01-28 20:14:07 +00:00
|
|
|
else ifeq ($(platform), wii)
|
2012-12-14 20:31:55 +00:00
|
|
|
TARGET := libretro_wii.a
|
|
|
|
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
|
|
|
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
|
|
|
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
|
2012-01-28 20:14:07 +00:00
|
|
|
ENDIANNESS_DEFINES = -DWORDS_BIGENDIAN
|
2012-04-01 18:58:41 +00:00
|
|
|
PLATFORM_DEFINES := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
|
|
|
|
EXTERNAL_ZLIB = 1
|
2012-01-27 20:56:17 +00:00
|
|
|
else
|
2012-06-09 00:15:47 +00:00
|
|
|
TARGET := retro.dll
|
2012-01-27 20:56:17 +00:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
2012-06-09 00:15:47 +00:00
|
|
|
SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)/link.T
|
2012-01-27 20:56:17 +00:00
|
|
|
LDFLAGS += -static-libgcc -static-libstdc++
|
|
|
|
ENDIANNESS_DEFINES := -DLSB_FIRST
|
|
|
|
endif
|
|
|
|
|
2012-12-14 20:31:55 +00:00
|
|
|
CC_SYSTEM = gcc
|
|
|
|
CXX_SYSTEM = g++
|
|
|
|
|
|
|
|
.PHONY: clean generate-files generate-files-clean clean-objs
|
2012-04-01 18:58:41 +00:00
|
|
|
|
2012-01-27 20:56:17 +00:00
|
|
|
all: $(TARGET)
|
|
|
|
|
2012-04-01 18:58:41 +00:00
|
|
|
BURN_BLACKLIST := $(FBA_BURNER_DIR)/un7z.cpp \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_CPU_DIR)/arm7/arm7exec.c \
|
|
|
|
$(FBA_CPU_DIR)/arm7/arm7core.c \
|
|
|
|
$(FBA_CPU_DIR)/hd6309/6309tbl.c \
|
|
|
|
$(FBA_CPU_DIR)/hd6309/6309ops.c \
|
|
|
|
$(FBA_CPU_DIR)/konami/konamtbl.c \
|
|
|
|
$(FBA_CPU_DIR)/konami/konamops.c \
|
|
|
|
$(FBA_CPU_DIR)/m68k/m68k_in.c \
|
|
|
|
$(FBA_CPU_DIR)/m6800/6800ops.c \
|
|
|
|
$(FBA_CPU_DIR)/m6800/6800tbl.c \
|
|
|
|
$(FBA_CPU_DIR)/m6805/6805ops.c \
|
|
|
|
$(FBA_CPU_DIR)/m6809/6809ops.c \
|
|
|
|
$(FBA_CPU_DIR)/m6809/6809tbl.c \
|
|
|
|
$(FBA_CPU_DIR)/sh2/mksh2.cpp \
|
|
|
|
$(FBA_CPU_DIR)/sh2/mksh2-x86.cpp \
|
|
|
|
$(FBA_CPU_DIR)/m68k/m68kmake.c \
|
|
|
|
$(FBA_BURNER_DIR)/wave_writer.cpp \
|
|
|
|
$(FBA_CPU_DIR)/m68k/m68kdasm.c \
|
2012-06-09 00:15:47 +00:00
|
|
|
$(FBA_LIBRETRO_DIR)/menu.cpp \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_CPU_DIR)/sh2/mksh2.cpp \
|
|
|
|
$(FBA_BURNER_DIR)/sshot.cpp \
|
|
|
|
$(FBA_BURNER_DIR)/conc.cpp \
|
|
|
|
$(FBA_BURNER_DIR)/dat.cpp \
|
|
|
|
$(FBA_BURNER_DIR)/cong.cpp \
|
|
|
|
$(FBA_BURNER_DIR)/image.cpp \
|
|
|
|
$(FBA_BURNER_DIR)/misc.cpp \
|
|
|
|
$(FBA_CPU_DIR)/h6280/tblh6280.c \
|
|
|
|
$(FBA_CPU_DIR)/m6502/t65sc02.c \
|
|
|
|
$(FBA_CPU_DIR)/m6502/t65c02.c \
|
|
|
|
$(FBA_CPU_DIR)/m6502/tdeco16.c \
|
|
|
|
$(FBA_CPU_DIR)/m6502/tn2a03.c \
|
|
|
|
$(FBA_CPU_DIR)/m6502/t6502.c \
|
|
|
|
$(FBA_CPU_DIR)/nec/v25sfr.c \
|
|
|
|
$(FBA_CPU_DIR)/nec/v25instr.c \
|
|
|
|
$(FBA_CPU_DIR)/nec/necinstr.c \
|
|
|
|
$(FBA_BURN_DIR)/drv/capcom/ctv_make.cpp
|
|
|
|
|
2012-12-14 20:31:55 +00:00
|
|
|
#ifeq ($(LIBRETRO_OPTIMIZATIONS), 1)
|
|
|
|
#BURN_BLACKLIST += $(FBA_BURN_DIR)/drv/capcom/ctv.cpp
|
|
|
|
#endif
|
2012-06-09 00:15:47 +00:00
|
|
|
|
2012-04-01 18:58:41 +00:00
|
|
|
ifeq ($(EXTERNAL_ZLIB), 1)
|
|
|
|
BURN_BLACKLIST += $(FBA_BURNER_DIR)/unzip.c \
|
|
|
|
$(FBA_BURNER_DIR)/ioapi.c
|
|
|
|
endif
|
|
|
|
|
2012-12-26 19:46:34 +00:00
|
|
|
ifeq ($(HAVE_GRIFFIN), 1)
|
|
|
|
GRIFFIN_CXXSRCFILES := $(GRIFFIN_DIR)/cps12.cpp $(GRIFFIN_DIR)/cps3.cpp $(GRIFFIN_DIR)/neogeo.cpp $(GRIFFIN_DIR)/pgm.cpp $(GRIFFIN_DIR)/snes.cpp $(GRIFFIN_DIR)/galaxian.cpp $(GRIFFIN_DIR)/cpu-m68k.cpp
|
|
|
|
BURN_BLACKLIST += $(FBA_CPU_DIR)/m68000_intf.cpp
|
|
|
|
else
|
|
|
|
CPS2_DIR := $(FBA_BURN_DRIVERS_DIR)/capcom
|
|
|
|
CPS3_DIR := $(FBA_BURN_DRIVERS_DIR)/cps3
|
|
|
|
GALAXIAN_DIR := $(FBA_BURN_DRIVERS_DIR)/galaxian
|
|
|
|
NEOGEO_DIR := $(FBA_BURN_DRIVERS_DIR)/neogeo
|
|
|
|
PGM_DIR := $(FBA_BURN_DRIVERS_DIR)/pgm
|
|
|
|
SNES_DIR := $(FBA_BURN_DRIVERS_DIR)/snes
|
|
|
|
M68K_DIR := $(FBA_CPU_DIR)/m68k
|
|
|
|
endif
|
2012-04-01 18:58:41 +00:00
|
|
|
|
2012-01-28 20:14:07 +00:00
|
|
|
FBA_BURN_DIRS := $(FBA_BURN_DIR) \
|
|
|
|
$(FBA_BURN_DIR)/devices \
|
|
|
|
$(FBA_BURN_DIR)/snd \
|
2012-12-26 19:46:34 +00:00
|
|
|
$(CPS2_DIR) \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/cave \
|
2012-12-26 19:46:34 +00:00
|
|
|
$(CPS3_DIR) \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/dataeast \
|
2012-12-26 19:46:34 +00:00
|
|
|
$(GALAXIAN_DIR) \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/irem \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/konami \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/megadrive \
|
2012-12-26 19:46:34 +00:00
|
|
|
$(NEOGEO_DIR) \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/pce \
|
2012-12-26 19:46:34 +00:00
|
|
|
$(PGM_DIR) \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/pre90s \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/psikyo \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/pst90s \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/sega \
|
2012-12-26 19:46:34 +00:00
|
|
|
$(SNES_DIR) \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/taito \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_BURN_DRIVERS_DIR)/toaplan
|
2012-01-28 20:14:07 +00:00
|
|
|
|
|
|
|
FBA_CPU_DIRS := $(FBA_CPU_DIR) \
|
|
|
|
$(FBA_CPU_DIR)/arm \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_CPU_DIR)/arm7 \
|
|
|
|
$(FBA_CPU_DIR)/h6280 \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_CPU_DIR)/hd6309 \
|
|
|
|
$(FBA_CPU_DIR)/i8039 \
|
|
|
|
$(FBA_CPU_DIR)/konami \
|
2012-12-26 19:46:34 +00:00
|
|
|
$(M68K_DIR) \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(FBA_CPU_DIR)/m6502 \
|
|
|
|
$(FBA_CPU_DIR)/m6800 \
|
|
|
|
$(FBA_CPU_DIR)/m6805 \
|
|
|
|
$(FBA_CPU_DIR)/m6809 \
|
|
|
|
$(FBA_CPU_DIR)/nec \
|
|
|
|
$(FBA_CPU_DIR)/s2650 \
|
|
|
|
$(FBA_CPU_DIR)/sh2 \
|
2012-04-01 18:58:41 +00:00
|
|
|
$(FBA_CPU_DIR)/z80
|
2012-01-28 20:14:07 +00:00
|
|
|
|
|
|
|
FBA_LIB_DIRS := $(FBA_LIB_DIR)/zlib
|
2012-01-27 20:56:17 +00:00
|
|
|
|
2012-04-01 18:58:41 +00:00
|
|
|
FBA_SRC_DIRS := $(FBA_BURNER_DIR) $(FBA_BURN_DIRS) $(FBA_CPU_DIRS) $(FBA_BURNER_DIRS)
|
|
|
|
|
2012-12-26 19:46:34 +00:00
|
|
|
|
2012-04-01 18:58:41 +00:00
|
|
|
ifeq ($(EXTERNAL_ZLIB), 1)
|
|
|
|
FBA_DEFINES += -DEXTERNAL_ZLIB
|
|
|
|
else
|
|
|
|
FBA_SRC_DIRS += $(FBA_LIB_DIRS)
|
|
|
|
endif
|
2012-01-27 20:56:17 +00:00
|
|
|
|
2012-12-26 19:46:34 +00:00
|
|
|
FBA_CXXSRCS := $(GRIFFIN_CXXSRCFILES) $(filter-out $(BURN_BLACKLIST),$(foreach dir,$(FBA_SRC_DIRS),$(wildcard $(dir)/*.cpp)))
|
2012-06-09 00:15:47 +00:00
|
|
|
FBA_CXXSRCS += $(LIBRETRO_DIR)/libretro.cpp $(LIBRETRO_DIR)/neocdlist.cpp
|
2012-01-27 20:56:17 +00:00
|
|
|
FBA_CXXOBJ := $(FBA_CXXSRCS:.cpp=.o)
|
|
|
|
FBA_CSRCS := $(filter-out $(BURN_BLACKLIST),$(foreach dir,$(FBA_SRC_DIRS),$(wildcard $(dir)/*.c)))
|
|
|
|
FBA_COBJ := $(FBA_CSRCS:.c=.o)
|
|
|
|
|
|
|
|
OBJS := $(FBA_COBJ) $(FBA_CXXOBJ)
|
|
|
|
|
2012-06-09 00:15:47 +00:00
|
|
|
FBA_DEFINES := -DUSE_SPEEDHACKS -D__LIBRETRO__ \
|
|
|
|
-D__LIBRETRO_OPTIMIZATIONS__ \
|
2012-01-28 20:14:07 +00:00
|
|
|
$(ENDIANNESS_DEFINES) \
|
|
|
|
$(PLATFORM_DEFINES) \
|
2012-04-01 18:58:41 +00:00
|
|
|
-DINLINE="static inline" \
|
|
|
|
-DSH2_INLINE="static inline"
|
2012-01-27 20:56:17 +00:00
|
|
|
|
2012-01-28 20:14:07 +00:00
|
|
|
INCDIRS := -I$(FBA_BURNER_DIR)/win32 \
|
2012-06-09 00:15:47 +00:00
|
|
|
-I$(LIBRETRO_DIR) \
|
|
|
|
-I$(LIBRETRO_DIR)/tchar \
|
2012-01-28 20:14:07 +00:00
|
|
|
-I$(FBA_BURN_DIR) \
|
|
|
|
-I$(MAIN_FBA_DIR)/cpu \
|
|
|
|
-I$(FBA_BURN_DIR)/snd \
|
|
|
|
-I$(FBA_BURN_DIR)/devices \
|
|
|
|
-I$(FBA_INTERFACE_DIR) \
|
|
|
|
-I$(FBA_INTERFACE_DIR)/input \
|
|
|
|
-I$(FBA_INTERFACE_DIR)/cd \
|
|
|
|
-I$(FBA_BURNER_DIR) \
|
|
|
|
-I$(FBA_CPU_DIR) \
|
|
|
|
-I$(FBA_CPU_DIR)/i8039 \
|
|
|
|
-I$(FBA_LIB_DIR)/zlib \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/capcom \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/dataeast \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/cave \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/neogeo \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/psikyo \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/sega \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/toaplan \
|
|
|
|
-I$(FBA_BURN_DIR)/drv/taito \
|
2012-12-14 20:31:55 +00:00
|
|
|
-I$(FBA_GENERATED_DIR) \
|
2012-01-28 20:14:07 +00:00
|
|
|
-I$(FBA_LIB_DIR)
|
2012-01-27 20:56:17 +00:00
|
|
|
|
2012-06-09 00:15:47 +00:00
|
|
|
ifeq ($(LIBRETRO_OPTIMIZATIONS), 1)
|
|
|
|
FBA_DEFINES += -D__LIBRETRO_OPTIMIZATIONS__
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS += -O0 -g
|
|
|
|
CXXFLAGS += -O0 -g
|
|
|
|
else
|
|
|
|
CFLAGS += -O3 -DNDEBUG
|
|
|
|
CXXFLAGS += -O3 -DNDEBUG
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(platform), sncps3)
|
|
|
|
WARNINGS_DEFINES =
|
|
|
|
else
|
|
|
|
WARNINGS_DEFINES = -Wno-write-strings
|
|
|
|
C_STD_DEFINES = -std=gnu99
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFLAGS += $(C_STD_DEFINES) $(fpic) $(WARNINGS_DEFINES) $(FBA_DEFINES)
|
|
|
|
CXXFLAGS += $(fpic) $(WARNINGS_DEFINES) $(FBA_DEFINES)
|
|
|
|
LDFLAGS += $(fpic)
|
|
|
|
|
2012-12-14 20:31:55 +00:00
|
|
|
ifeq ($(FRONTEND_SUPPORTS_RGB565), 1)
|
|
|
|
CFLAGS += -DFRONTEND_SUPPORTS_RGB565
|
|
|
|
CXXFLAGS += -DFRONTEND_SUPPORTS_RGB565
|
|
|
|
endif
|
2012-06-09 00:15:47 +00:00
|
|
|
|
2012-04-01 18:58:41 +00:00
|
|
|
ifeq ($(ZLIB_INTERNAL), 0)
|
|
|
|
INCDIRS += -I$(FBA_LIB_DIR)
|
|
|
|
endif
|
|
|
|
|
2012-12-14 20:31:55 +00:00
|
|
|
ifeq ($(LIBRETRO_OPTIMIZATIONS), 1)
|
|
|
|
GENERATE_OPTS := -D__LIBRETRO_OPTIMIZATIONS__
|
|
|
|
else
|
|
|
|
GENERATE_OPTS :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
PERL = perl$(EXE_EXT)
|
|
|
|
M68KMAKE_EXE = m68kmake$(EXE_EXT)
|
|
|
|
CTVMAKE_EXE = ctvmake$(EXE_EXT)
|
|
|
|
PGM_SPRITE_CREATE_EXE = pgmspritecreate$(EXE_EXT)
|
|
|
|
EXE_PREFIX = ./
|
|
|
|
|
|
|
|
generate-files-clean:
|
|
|
|
rm -rf $(FBA_GENERATED_DIR)/
|
|
|
|
rm -rf $(FBA_CPU_DIR)/m68k/m68kopac.c
|
|
|
|
rm -rf $(FBA_CPU_DIR)/m68k/m68kopdm.c
|
|
|
|
rm -rf $(FBA_CPU_DIR)/m68k/m68kopnz.c
|
|
|
|
rm -rf $(FBA_CPU_DIR)/m68k/m68kops.c
|
|
|
|
rm -rf $(FBA_CPU_DIR)/m68k/m68kops.h
|
2012-04-01 18:58:41 +00:00
|
|
|
|
2012-12-14 20:31:55 +00:00
|
|
|
generate-files:
|
|
|
|
@mkdir -p $(FBA_GENERATED_DIR) 2>/dev/null || /bin/true
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/driverlist.h..."
|
|
|
|
@echo ""
|
|
|
|
$(PERL) $(FBA_SCRIPTS_DIR)/gamelist.pl -o $(FBA_GENERATED_DIR)/driverlist.h -l gamelist.txt $(FBA_BURN_DRIVERS_DIR)/capcom $(FBA_BURN_DRIVERS_DIR)/cave $(FBA_BURN_DRIVERS_DIR)/cps3 $(FBA_BURN_DRIVERS_DIR)/dataeast $(FBA_BURN_DRIVERS_DIR)/galaxian $(FBA_BURN_DRIVERS_DIR)/irem $(FBA_BURN_DRIVERS_DIR)/konami $(FBA_BURN_DRIVERS_DIR)/megadrive $(FBA_BURN_DRIVERS_DIR)/neogeo $(FBA_BURN_DRIVERS_DIR)/pce $(FBA_BURN_DRIVERS_DIR)/pgm $(FBA_BURN_DRIVERS_DIR)/pre90s $(FBA_BURN_DRIVERS_DIR)/psikyo $(FBA_BURN_DRIVERS_DIR)/pst90s $(FBA_BURN_DRIVERS_DIR)/sega $(FBA_BURN_DRIVERS_DIR)/snes $(FBA_BURN_DRIVERS_DIR)/taito $(FBA_BURN_DRIVERS_DIR)/toaplan
|
|
|
|
@echo ""
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/neo_sprite_func.h..."
|
|
|
|
@echo ""
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/neo_sprite_func_table.h..."
|
|
|
|
@echo ""
|
|
|
|
$(PERL) $(FBA_SCRIPTS_DIR)/neo_sprite_func.pl -o $(FBA_GENERATED_DIR)/neo_sprite_func.h $(LIBRETRO_OPTIMIZATIONS)
|
|
|
|
@echo ""
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/psikyo_tile_func.h..."
|
|
|
|
@echo ""
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/psikyo_tile_func_table.h..."
|
|
|
|
@echo ""
|
|
|
|
$(PERL) $(FBA_SCRIPTS_DIR)/psikyo_tile_func.pl -o $(FBA_GENERATED_DIR)/psikyo_tile_func.h
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/cave_sprite_func.h..."
|
|
|
|
@echo ""
|
|
|
|
@echo "Generating[ $(FBA_GENERATED_DIR)/cave_tile_func_table.h"
|
|
|
|
@echo ""
|
|
|
|
$(PERL) $(FBA_SCRIPTS_DIR)/cave_sprite_func.pl -o $(FBA_GENERATED_DIR)/cave_sprite_func.h
|
|
|
|
$(PERL) $(FBA_SCRIPTS_DIR)/cave_tile_func.pl -o $(FBA_GENERATED_DIR)/cave_tile_func.h
|
|
|
|
@echo ""
|
|
|
|
@echo "Generate $(FBA_GENERATED_DIR)/toa_gp9001_func_table.h"
|
|
|
|
@echo ""
|
|
|
|
$(PERL) $(FBA_SCRIPTS_DIR)/toa_gp9001_func.pl -o $(FBA_GENERATED_DIR)/toa_gp9001_func.h
|
|
|
|
$(CXX_SYSTEM) $(GENERATE_OPTS) -o $(PGM_SPRITE_CREATE_EXE) $(FBA_BURN_DRIVERS_DIR)/pgm/pgm_sprite_create.cpp
|
|
|
|
@echo ""
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/pgm_sprite.h..."
|
|
|
|
@echo ""
|
|
|
|
$(EXE_PREFIX)$(PGM_SPRITE_CREATE_EXE) > $(FBA_GENERATED_DIR)/pgm_sprite.h
|
|
|
|
$(CC_SYSTEM) $(GENERATE_OPTS) -o $(M68KMAKE_EXE) $(FBA_CPU_DIR)/m68k/m68kmake.c
|
|
|
|
$(EXE_PREFIX)$(M68KMAKE_EXE) $(FBA_CPU_DIR)/m68k/ $(FBA_CPU_DIR)/m68k/m68k_in.c
|
|
|
|
$(CXX_SYSTEM) $(GENERATE_OPTS) -o $(CTVMAKE_EXE) $(FBA_BURN_DRIVERS_DIR)/capcom/ctv_make.cpp
|
|
|
|
@echo ""
|
|
|
|
@echo "Generating $(FBA_GENERATED_DIR)/ctv.h..."
|
|
|
|
@echo ""
|
|
|
|
$(EXE_PREFIX)$(CTVMAKE_EXE) > $(FBA_GENERATED_DIR)/ctv.h
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
2012-01-27 20:56:17 +00:00
|
|
|
@echo "LD $@"
|
|
|
|
ifeq ($(platform), ps3)
|
2012-04-01 18:58:41 +00:00
|
|
|
@$(AR) rcs $@ $(OBJS)
|
|
|
|
else ifeq ($(platform), sncps3)
|
|
|
|
$(AR) rcs $@ $(OBJS)
|
2012-12-14 20:31:55 +00:00
|
|
|
else ifeq ($(platform), psl1ght)
|
|
|
|
$(AR) rcs $@ $(OBJS)
|
2012-01-28 20:14:07 +00:00
|
|
|
else ifeq ($(platform), xenon)
|
2012-04-01 18:58:41 +00:00
|
|
|
@$(AR) rcs $@ $(OBJS)
|
2012-12-14 20:31:55 +00:00
|
|
|
else ifeq ($(platform), ngc)
|
|
|
|
@$(AR) rcs $@ $(OBJS)
|
2012-01-28 20:14:07 +00:00
|
|
|
else ifeq ($(platform), wii)
|
2012-04-01 18:58:41 +00:00
|
|
|
@$(AR) rcs $@ $(OBJS)
|
2012-01-27 20:56:17 +00:00
|
|
|
else
|
|
|
|
@$(CXX) -o $@ $(SHARED) $(OBJS) $(LDFLAGS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
@echo "CXX $<"
|
|
|
|
@$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
@echo "CC $<"
|
|
|
|
@$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS)
|
|
|
|
|
2012-12-14 20:31:55 +00:00
|
|
|
clean-objs:
|
|
|
|
rm -f $(OBJS)
|
|
|
|
|
2012-01-27 20:56:17 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(TARGET)
|
|
|
|
rm -f $(OBJS)
|
2012-12-14 20:31:55 +00:00
|
|
|
rm -f $(M68KMAKE_EXE)
|
|
|
|
rm -f $(PGM_SPRITE_CREATE_EXE)
|
|
|
|
rm -f $(CTVMAKE_EXE)
|