RetroArch/Makefile.win

193 lines
4.3 KiB
Makefile
Raw Normal View History

2011-01-07 17:59:53 +01:00
TARGET = ssnes.exe
2011-01-24 22:15:49 +01:00
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 autosave.o gfx/gfx_common.o bps.o ups.o strl.o screenshot.o audio/hermite.o thread.o
JOBJ = conf/config_file.o tools/main-stub.o tools/ssnes-joyconfig.o strl.o
2011-01-07 17:59:53 +01:00
CC = gcc
CXX = g++
2011-06-10 16:55:05 +02:00
HAVE_DINPUT = 1
HAVE_XAUDIO = 1
HAVE_DSOUND = 1
2011-08-28 21:47:58 +02:00
HAVE_SDL = 1
2011-11-02 17:02:59 +01:00
HAVE_OPENGL = 1
2011-05-11 17:52:16 +02:00
HAVE_DYLIB = 1
2011-08-28 22:43:50 +02:00
HAVE_NETPLAY = 1
DYNAMIC = 1
2011-08-28 21:47:58 +02:00
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
2011-08-28 21:47:58 +02:00
endif
libsnes ?= -lsnes
2011-01-07 17:59:53 +01:00
2011-08-22 18:13:30 +02:00
LIBS = -lm -lshlwapi
DEFINES = -I. -DHAVE_CONFIGFILE
2011-08-20 03:25:44 +02:00
LDFLAGS = -L. -static-libgcc -s
LDCXXFLAGS = -static-libstdc++
2011-01-07 17:59:53 +01:00
ifeq ($(HAVE_SDL), 1)
OBJ += gfx/sdl.o gfx/gl.o gfx/sdlwrap.o input/sdl.o audio/sdl.o fifo_buffer.o
2011-11-02 17:04:49 +01:00
LIBS += -lSDL
DEFINES += -ISDL -DHAVE_SDL
endif
2011-11-02 17:04:49 +01:00
ifeq ($(HAVE_OPENGL), 1)
DEFINES += -DHAVE_OPENGL
LIBS += -lopengl32
endif
2011-06-11 18:13:12 +02:00
ifeq ($(HAVE_SDL_IMAGE), 1)
LIBS += -lSDL_image
DEFINES += -DHAVE_SDL_IMAGE
endif
2011-05-18 22:40:42 +02:00
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
2011-01-29 23:53:38 +01:00
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
2011-08-28 22:20:15 +02:00
LIBS += -lxml2 -liconv
2011-01-07 17:59:53 +01:00
endif
2011-05-11 17:52:16 +02:00
ifeq ($(HAVE_DYLIB), 1)
DEFINES += -DHAVE_DYLIB
2011-03-07 20:22:55 +01:00
endif
2011-03-19 20:42:49 +01:00
ifeq ($(HAVE_NETPLAY), 1)
DEFINES += -DHAVE_NETPLAY
OBJ += netplay.o
LIBS += -lws2_32
endif
2011-01-24 21:46:43 +01:00
ifeq ($(HAVE_FREETYPE), 1)
OBJ += gfx/fonts.o
DEFINES += -DHAVE_FREETYPE -Ifreetype2
2011-08-28 22:19:02 +02:00
LIBS += -lfreetype -lz
2011-01-24 21:46:43 +01:00
endif
2011-01-19 13:25:18 +01:00
ifeq ($(DYNAMIC), 1)
DEFINES += -DHAVE_DYNAMIC
else
LIBS += $(libsnes)
2011-01-19 13:25:18 +01:00
endif
2011-03-23 23:48:13 +01:00
ifeq ($(HAVE_FBO), 1)
DEFINES += -DHAVE_FBO
endif
2011-05-11 17:52:16 +02:00
ifeq ($(HAVE_DYLIB), 1)
2011-05-15 01:46:11 +02:00
OBJ += gfx/ext.o audio/ext.o
2011-05-11 17:52:16 +02:00
endif
2011-06-09 13:56:29 +02:00
ifeq ($(HAVE_PYTHON), 1)
LIBS += -lpython32
DEFINES += -DHAVE_PYTHON -Ipython
OBJ += gfx/py_state/py_state.o
endif
2011-06-10 16:55:05 +02:00
ifeq ($(HAVE_DINPUT), 1)
LIBS += -ldinput8 -ldxguid -lole32
2011-08-19 19:16:53 +02:00
DEFINES += -DHAVE_DINPUT
2011-06-10 16:55:05 +02:00
OBJ += input/dinput.o
endif
2011-06-14 23:59:00 +02:00
ifeq ($(HAVE_FFMPEG), 1)
2011-08-28 22:19:02 +02:00
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
2011-08-19 19:16:53 +02:00
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
2011-10-10 22:24:26 +02:00
DEFINES += -DHAVE_X264RGB
2011-06-14 23:59:00 +02:00
OBJ += record/ffemu.o
endif
2011-01-10 17:20:08 +01:00
ifneq ($(V),1)
2011-01-10 17:15:27 +01:00
Q := @
endif
CFLAGS += -Wall -O3 -std=gnu99 -I.
CXXFLAGS += -Wall -O3 -pedantic -I.
2011-01-07 17:59:53 +01:00
2011-01-24 22:15:49 +01:00
all: $(TARGET) $(JTARGET)
2011-01-07 17:59:53 +01:00
$(TARGET): $(OBJ)
2011-08-20 03:25:44 +02:00
$(Q)$(CXX) -o $@ $(OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
2011-01-10 17:15:27 +01:00
@$(if $(Q), $(shell echo echo LD $@),)
2011-01-09 16:08:06 +01:00
2011-01-07 17:59:53 +01:00
%.o: %.c
2011-01-10 17:15:27 +01:00
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
@$(if $(Q), $(shell echo echo CC $<),)
2011-01-09 19:50:23 +01:00
%.o: %.cpp
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -c -o $@ $<
@$(if $(Q), $(shell echo echo CXX $<),)
2011-01-24 22:15:49 +01:00
$(JTARGET): $(JOBJ)
2011-08-28 22:19:02 +02:00
$(Q)$(CC) -o $@ $(JOBJ) -lSDL $(LDFLAGS)
2011-01-10 17:15:27 +01:00
@$(if $(Q), $(shell echo echo LD $@),)
2011-01-09 17:24:13 +01:00
2011-01-07 17:59:53 +01:00
clean:
rm -f *.o
rm -f audio/*.o
rm -f audio/xaudio-c/*.o
2011-01-07 17:59:53 +01:00
rm -f conf/*.o
rm -f gfx/*.o
2011-06-09 13:56:29 +02:00
rm -f gfx/py_state/*.o
2011-01-07 17:59:53 +01:00
rm -f record/*.o
2011-01-10 17:20:08 +01:00
rm -f input/*.o
2011-01-07 17:59:53 +01:00
rm -f $(TARGET)
2011-01-09 16:08:06 +01:00
rm -f ssnes-joyconfig.exe
2011-01-09 17:24:13 +01:00
rm -f tools/*.o
2011-01-07 17:59:53 +01:00
dist_x86: all
2011-10-30 11:24:16 +01:00
zip -r ssnes-win32-0.9.1.zip $(TARGET) $(JTARGET) ssnes.cfg snes.dll SDL.dll
dist_x86_64: all
2011-10-30 11:24:16 +01:00
zip -r ssnes-win64-0.9.1.zip $(TARGET) $(JTARGET) ssnes.cfg snes.dll SDL.dll
2011-01-24 21:46:43 +01:00
libs_x86:
2011-01-24 21:46:43 +01:00
wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-libs.zip --no-check-certificate
unzip SSNES-win32-libs.zip
2011-10-08 17:01:40 +02:00
wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-headers.zip --no-check-certificate
unzip SSNES-win32-headers.zip
2011-01-08 20:05:41 +01:00
libs_x86_64:
wget https://github.com/downloads/Themaister/SSNES/SSNES-win64-libs.zip --no-check-certificate
unzip SSNES-win64-libs.zip
2011-10-08 17:01:40 +02:00
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