2011-01-07 16:59:53 +00:00
|
|
|
TARGET = ssnes.exe
|
2011-01-24 21:15:49 +00:00
|
|
|
JTARGET = ssnes-joyconfig.exe
|
2011-04-03 20:16:59 +00:00
|
|
|
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 ups.o strl.o
|
2011-01-09 18:50:23 +00:00
|
|
|
JOBJ = conf/config_file.o tools/main-stub.o tools/ssnes-joyconfig.o
|
2011-01-07 16:59:53 +00:00
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
|
|
|
|
2011-02-06 12:37:41 +00:00
|
|
|
HAVE_SRC = 0
|
2011-01-07 16:59:53 +00:00
|
|
|
HAVE_SDL = 1
|
2011-01-07 17:26:19 +00:00
|
|
|
HAVE_XML = 1
|
2011-01-24 20:46:43 +00:00
|
|
|
HAVE_FREETYPE = 1
|
2011-01-27 00:46:00 +00:00
|
|
|
HAVE_XAUDIO = 1
|
2011-02-09 22:04:11 +00:00
|
|
|
HAVE_RSOUND = 1
|
2011-05-11 15:52:16 +00:00
|
|
|
HAVE_DYLIB = 1
|
2011-03-19 19:42:49 +00:00
|
|
|
HAVE_NETPLAY = 1
|
2011-03-23 22:48:13 +00:00
|
|
|
HAVE_FBO = 1
|
2011-01-07 17:11:06 +00:00
|
|
|
libsnes ?= -lsnes
|
2011-01-07 16:59:53 +00:00
|
|
|
|
2011-03-19 19:42:49 +00:00
|
|
|
LIBS = -lm
|
2011-01-19 12:07:11 +00:00
|
|
|
DEFINES = -I. -DHAVE_CONFIGFILE
|
2011-01-08 18:44:15 +00:00
|
|
|
LDFLAGS = -L. -static-libgcc -s
|
2011-01-07 16:59:53 +00:00
|
|
|
|
|
|
|
SRC_LIBS = -lsamplerate-0
|
2011-01-09 18:37:55 +00:00
|
|
|
SDL_LIBS = -lSDL
|
2011-01-07 17:11:06 +00:00
|
|
|
SDL_CFLAGS = -ISDL
|
2011-01-07 16:59:53 +00:00
|
|
|
|
|
|
|
ifeq ($(HAVE_SRC), 1)
|
|
|
|
LIBS += $(SRC_LIBS)
|
2011-01-07 17:26:19 +00:00
|
|
|
DEFINES += $(SRC_CFLAGS) -DHAVE_SRC
|
2011-02-06 12:37:41 +00:00
|
|
|
else
|
|
|
|
OBJ += audio/hermite.o
|
2011-01-07 16:59:53 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(HAVE_SDL), 1)
|
2011-04-21 01:23:44 +00:00
|
|
|
OBJ += gfx/sdl.o gfx/gl.o input/sdl.o audio/sdl.o audio/buffer.o
|
2011-01-07 16:59:53 +00:00
|
|
|
LIBS += $(SDL_LIBS) -lopengl32
|
2011-01-07 17:26:19 +00:00
|
|
|
DEFINES += $(SDL_CFLAGS) -DHAVE_SDL
|
|
|
|
endif
|
|
|
|
|
2011-01-27 00:46:00 +00:00
|
|
|
ifeq ($(HAVE_XAUDIO), 1)
|
|
|
|
OBJ += audio/xaudio.o
|
|
|
|
DEFINES += -DHAVE_XAUDIO
|
|
|
|
endif
|
|
|
|
|
2011-01-29 22:53:38 +00:00
|
|
|
ifeq ($(HAVE_RSOUND), 1)
|
|
|
|
OBJ += audio/rsound.o
|
|
|
|
DEFINES += -DHAVE_RSOUND
|
|
|
|
LIBS += -lrsound
|
|
|
|
endif
|
|
|
|
|
2011-01-07 17:26:19 +00:00
|
|
|
ifeq ($(HAVE_XML), 1)
|
2011-04-17 11:30:59 +00:00
|
|
|
OBJ += gfx/shader_glsl.o sha256.o cheats.o
|
2011-01-07 17:26:19 +00:00
|
|
|
DEFINES += $(XML_CFLAGS) -DHAVE_XML
|
|
|
|
LIBS += -lxml2
|
2011-01-07 16:59:53 +00:00
|
|
|
endif
|
|
|
|
|
2011-05-11 15:52:16 +00:00
|
|
|
ifeq ($(HAVE_DYLIB), 1)
|
|
|
|
DEFINES += -DHAVE_DYLIB
|
2011-03-07 19:22:55 +00:00
|
|
|
endif
|
|
|
|
|
2011-03-19 19:42:49 +00:00
|
|
|
ifeq ($(HAVE_NETPLAY), 1)
|
|
|
|
DEFINES += -DHAVE_NETPLAY
|
|
|
|
OBJ += netplay.o
|
|
|
|
LIBS += -lws2_32
|
|
|
|
endif
|
|
|
|
|
2011-01-24 20:46:43 +00:00
|
|
|
ifeq ($(HAVE_FREETYPE), 1)
|
|
|
|
OBJ += gfx/fonts.o
|
|
|
|
DEFINES += -DHAVE_FREETYPE -Ifreetype2
|
|
|
|
LIBS += -lz -lfreetype6
|
|
|
|
endif
|
|
|
|
|
2011-01-19 12:25:18 +00:00
|
|
|
ifeq ($(DYNAMIC), 1)
|
|
|
|
DEFINES += -DHAVE_DYNAMIC
|
2011-01-19 15:11:45 +00:00
|
|
|
else
|
|
|
|
LIBS += $(libsnes)
|
2011-01-19 12:25:18 +00:00
|
|
|
endif
|
|
|
|
|
2011-03-23 22:48:13 +00:00
|
|
|
ifeq ($(HAVE_FBO), 1)
|
|
|
|
DEFINES += -DHAVE_FBO
|
|
|
|
endif
|
|
|
|
|
2011-05-11 15:52:16 +00:00
|
|
|
ifeq ($(HAVE_DYLIB), 1)
|
|
|
|
OBJ += gfx/ext.c
|
|
|
|
endif
|
|
|
|
|
2011-01-10 16:20:08 +00:00
|
|
|
ifneq ($(V),1)
|
2011-01-10 16:15:27 +00:00
|
|
|
Q := @
|
|
|
|
endif
|
|
|
|
|
2011-01-07 16:59:53 +00:00
|
|
|
|
2011-01-08 18:44:15 +00:00
|
|
|
CFLAGS = -Wall -O3 -std=gnu99 -I.
|
2011-01-07 16:59:53 +00:00
|
|
|
|
2011-01-24 21:15:49 +00:00
|
|
|
all: $(TARGET) $(JTARGET)
|
2011-01-07 16:59:53 +00:00
|
|
|
|
|
|
|
$(TARGET): $(OBJ)
|
2011-01-10 16:15:27 +00:00
|
|
|
$(Q)$(CXX) -o $@ $(OBJ) $(LIBS) $(LDFLAGS)
|
|
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
2011-01-09 15:08:06 +00:00
|
|
|
|
2011-01-07 16:59:53 +00:00
|
|
|
%.o: %.c
|
2011-01-10 16:15:27 +00:00
|
|
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
|
|
|
@$(if $(Q), $(shell echo echo CC $<),)
|
2011-01-09 18:50:23 +00:00
|
|
|
|
2011-01-24 21:15:49 +00:00
|
|
|
$(JTARGET): $(JOBJ)
|
|
|
|
$(Q)$(CC) -o $@ $(JOBJ) $(SDL_LIBS) $(LDFLAGS)
|
2011-01-10 16:15:27 +00:00
|
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
2011-01-09 16:24:13 +00:00
|
|
|
|
2011-01-07 16:59:53 +00:00
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
rm -f audio/*.o
|
|
|
|
rm -f conf/*.o
|
|
|
|
rm -f gfx/*.o
|
|
|
|
rm -f record/*.o
|
|
|
|
rm -f hqflt/*.o
|
2011-01-10 16:20:08 +00:00
|
|
|
rm -f input/*.o
|
2011-01-07 16:59:53 +00:00
|
|
|
rm -f hqflt/snes_ntsc/*.o
|
|
|
|
rm -f $(TARGET)
|
2011-01-09 15:08:06 +00:00
|
|
|
rm -f ssnes-joyconfig.exe
|
2011-01-09 16:24:13 +00:00
|
|
|
rm -f tools/*.o
|
2011-01-07 16:59:53 +00:00
|
|
|
|
2011-01-08 19:05:41 +00:00
|
|
|
dist: all
|
2011-04-26 17:00:50 +00:00
|
|
|
zip -r ssnes-win32-0.4.1.zip $(TARGET) ssnes.cfg snes.dll libxml2.dll iconv.dll zlib1.dll SDL.dll freetype6.dll xaudio-c.dll rsound.dll pthreadGC2.dll README.win32.txt $(JTARGET)
|
2011-01-24 20:46:43 +00:00
|
|
|
|
|
|
|
libs:
|
|
|
|
wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-libs.zip --no-check-certificate
|
|
|
|
unzip SSNES-win32-libs.zip
|
2011-01-08 19:05:41 +00:00
|
|
|
|
2011-01-24 22:33:47 +00:00
|
|
|
.PHONY: all install uninstall clean dist libs
|