mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
209 lines
4.6 KiB
Makefile
209 lines
4.6 KiB
Makefile
TARGET = ssnes.exe
|
|
JTARGET = ssnes-joyconfig.exe
|
|
OBJ = ssnes.o file.o driver.o conf/config_file.o settings.o dynamic.o message.o rewind.o movie.o gfx/gfx_common.o bps.o ups.o strl.o screenshot.o getopt.o audio/utils.o posix_string.o
|
|
JOBJ = conf/config_file.o tools/ssnes-joyconfig.o strl.o posix_string.o
|
|
|
|
CC = gcc
|
|
CXX = g++
|
|
|
|
HAVE_DINPUT = 1
|
|
HAVE_XAUDIO = 1
|
|
HAVE_DSOUND = 1
|
|
HAVE_SDL = 1
|
|
HAVE_OPENGL = 1
|
|
HAVE_DYLIB = 1
|
|
HAVE_NETPLAY = 1
|
|
HAVE_THREADS = 1
|
|
DYNAMIC = 1
|
|
|
|
ifeq ($(SLIM),)
|
|
HAVE_SDL_IMAGE = 1
|
|
HAVE_XML = 1
|
|
HAVE_FREETYPE = 1
|
|
HAVE_RSOUND = 1
|
|
HAVE_FBO = 1
|
|
HAVE_CG = 1
|
|
HAVE_PYTHON = 1
|
|
HAVE_FFMPEG = 1
|
|
endif
|
|
|
|
libsnes ?= -lsnes
|
|
|
|
LIBS = -lm
|
|
DEFINES = -I. -DHAVE_CONFIGFILE -DPACKAGE_VERSION=\"0.9.4.1\"
|
|
LDFLAGS = -L. -static-libgcc
|
|
LDCXXFLAGS = -static-libstdc++ -s
|
|
|
|
ifeq ($(HAVE_SDL), 1)
|
|
OBJ += gfx/sdl_gfx.o gfx/gl.o gfx/sdlwrap.o input/sdl_input.o audio/sdl_audio.o fifo_buffer.o
|
|
LIBS += -lSDL
|
|
DEFINES += -ISDL -DHAVE_SDL
|
|
endif
|
|
|
|
ifeq ($(HAVE_THREADS), 1)
|
|
OBJ += autosave.o thread.o
|
|
DEFINES += -DHAVE_THREADS
|
|
endif
|
|
|
|
ifeq ($(HAVE_OPENGL), 1)
|
|
DEFINES += -DHAVE_OPENGL
|
|
LIBS += -lopengl32
|
|
endif
|
|
|
|
ifeq ($(HAVE_SDL_IMAGE), 1)
|
|
LIBS += -lSDL_image
|
|
DEFINES += -DHAVE_SDL_IMAGE
|
|
endif
|
|
|
|
ifeq ($(HAVE_CG), 1)
|
|
OBJ += gfx/shader_cg.o
|
|
LIBS += -lcg -lcgGL
|
|
DEFINES += -DHAVE_CG
|
|
endif
|
|
|
|
ifeq ($(HAVE_XAUDIO), 1)
|
|
OBJ += audio/xaudio.o audio/xaudio-c/xaudio-c.o
|
|
DEFINES += -DHAVE_XAUDIO
|
|
LIBS += -lole32
|
|
endif
|
|
|
|
ifeq ($(HAVE_DSOUND), 1)
|
|
OBJ += audio/dsound.o
|
|
DEFINES += -DHAVE_DSOUND
|
|
LIBS += -ldxguid -ldsound
|
|
endif
|
|
|
|
ifeq ($(HAVE_RSOUND), 1)
|
|
OBJ += audio/rsound.o
|
|
DEFINES += -DHAVE_RSOUND
|
|
LIBS += -lrsound
|
|
endif
|
|
|
|
ifeq ($(HAVE_XML), 1)
|
|
OBJ += gfx/shader_glsl.o gfx/image.o gfx/snes_state.o sha256.o cheats.o
|
|
DEFINES += -Ilibxml2 -DHAVE_XML
|
|
LIBS += -lxml2 -liconv
|
|
endif
|
|
|
|
ifeq ($(HAVE_DYLIB), 1)
|
|
DEFINES += -DHAVE_DYLIB
|
|
endif
|
|
|
|
ifeq ($(HAVE_NETPLAY), 1)
|
|
DEFINES += -DHAVE_NETPLAY
|
|
OBJ += netplay.o
|
|
LIBS += -lws2_32
|
|
endif
|
|
|
|
ifeq ($(HAVE_FREETYPE), 1)
|
|
OBJ += gfx/fonts.o
|
|
DEFINES += -DHAVE_FREETYPE -Ifreetype2
|
|
LIBS += -lfreetype -lz
|
|
endif
|
|
|
|
ifeq ($(DYNAMIC), 1)
|
|
DEFINES += -DHAVE_DYNAMIC
|
|
else
|
|
LIBS += $(libsnes)
|
|
endif
|
|
|
|
ifeq ($(HAVE_FBO), 1)
|
|
DEFINES += -DHAVE_FBO
|
|
endif
|
|
|
|
ifeq ($(HAVE_DYLIB), 1)
|
|
OBJ += gfx/ext_gfx.o audio/ext_audio.o
|
|
endif
|
|
|
|
ifeq ($(HAVE_PYTHON), 1)
|
|
LIBS += -lpython32
|
|
DEFINES += -DHAVE_PYTHON -Ipython
|
|
OBJ += gfx/py_state/py_state.o
|
|
endif
|
|
|
|
ifeq ($(HAVE_DINPUT), 1)
|
|
LIBS += -ldinput8 -ldxguid -lole32
|
|
DEFINES += -DHAVE_DINPUT
|
|
OBJ += input/dinput.o
|
|
endif
|
|
|
|
ifeq ($(HAVE_FFMPEG), 1)
|
|
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
|
|
DEFINES += -DHAVE_FFMPEG -Iffmpeg
|
|
DEFINES += -DHAVE_FFMPEG_ALLOC_CONTEXT3
|
|
DEFINES += -DHAVE_FFMPEG_AVCODEC_OPEN2
|
|
DEFINES += -DHAVE_FFMPEG_AVIO_OPEN
|
|
DEFINES += -DHAVE_FFMPEG_AVFORMAT_WRITE_HEADER
|
|
DEFINES += -DHAVE_FFMPEG_AVFORMAT_NEW_STREAM
|
|
DEFINES += -DHAVE_X264RGB
|
|
OBJ += record/ffemu.o
|
|
endif
|
|
|
|
ifeq ($(HAVE_SINC), 1)
|
|
OBJ += audio/sinc.o
|
|
else
|
|
OBJ += audio/hermite.o
|
|
endif
|
|
|
|
ifneq ($(V), 1)
|
|
Q := @
|
|
endif
|
|
|
|
CFLAGS += -Wall -O3 -I.
|
|
ifeq ($(CXX_BUILD), 1)
|
|
CFLAGS += -std=c++0x -xc++ -D__STDC_CONSTANT_MACROS
|
|
else
|
|
CFLAGS += -std=gnu99
|
|
endif
|
|
|
|
all: $(TARGET) $(JTARGET)
|
|
|
|
$(TARGET): $(OBJ)
|
|
$(Q)$(CXX) -o $@ $(OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
|
|
|
%.o: %.c
|
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
|
@$(if $(Q), $(shell echo echo CC $<),)
|
|
|
|
$(JTARGET): $(JOBJ)
|
|
ifeq ($(CXX_BUILD), 1)
|
|
$(Q)$(CXX) -o $@ $(JOBJ) -lSDL $(LDFLAGS)
|
|
else
|
|
$(Q)$(CC) -o $@ $(JOBJ) -lSDL $(LDFLAGS)
|
|
endif
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
|
|
|
clean:
|
|
rm -f *.o
|
|
rm -f audio/*.o
|
|
rm -f audio/xaudio-c/*.o
|
|
rm -f conf/*.o
|
|
rm -f gfx/*.o
|
|
rm -f gfx/py_state/*.o
|
|
rm -f record/*.o
|
|
rm -f input/*.o
|
|
rm -f $(TARGET)
|
|
rm -f ssnes-joyconfig.exe
|
|
rm -f tools/*.o
|
|
|
|
dist_x86: all
|
|
zip -r ssnes-win32-0.9.4.1.zip $(TARGET) $(JTARGET) ssnes.cfg snes.dll SDL.dll
|
|
|
|
dist_x86_64: all
|
|
zip -r ssnes-win64-0.9.4.1.zip $(TARGET) $(JTARGET) ssnes.cfg snes.dll SDL.dll
|
|
|
|
libs_x86:
|
|
wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-libs.zip --no-check-certificate
|
|
unzip SSNES-win32-libs.zip
|
|
wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-headers.zip --no-check-certificate
|
|
unzip SSNES-win32-headers.zip
|
|
|
|
libs_x86_64:
|
|
wget https://github.com/downloads/Themaister/SSNES/SSNES-win64-libs.zip --no-check-certificate
|
|
unzip SSNES-win64-libs.zip
|
|
wget https://github.com/downloads/Themaister/SSNES/SSNES-win64-headers.zip --no-check-certificate
|
|
unzip SSNES-win64-headers.zip
|
|
|
|
.PHONY: all install uninstall clean dist_x86 dist_x86_64 libs_x86 libs_x86_64
|