2010-05-29 15:01:11 +00:00
|
|
|
include config.mk
|
2010-05-28 12:04:50 +00:00
|
|
|
|
2011-01-09 14:58:49 +00:00
|
|
|
TARGET = ssnes tools/ssnes-joyconfig
|
2010-05-26 19:27:37 +00:00
|
|
|
|
2011-04-03 20:16:59 +00:00
|
|
|
OBJ = ssnes.o file.o driver.o settings.o dynamic.o message.o rewind.o movie.o autosave.o gfx/gfx_common.o ups.o strl.o
|
2011-01-09 14:58:49 +00:00
|
|
|
JOYCONFIG_OBJ = tools/ssnes-joyconfig.o conf/config_file.o
|
2011-01-10 14:01:34 +00:00
|
|
|
HEADERS = $(wildcard */*.h) $(wildcard *.h)
|
2010-11-19 20:26:31 +00:00
|
|
|
|
2011-03-07 19:17:27 +00:00
|
|
|
LIBS = -lm
|
2011-01-07 16:59:53 +00:00
|
|
|
DEFINES = -DHAVE_CONFIG_H
|
2010-05-28 12:04:50 +00:00
|
|
|
|
2011-02-04 21:47:37 +00:00
|
|
|
ifneq ($(findstring Darwin,$(shell uname -a)),)
|
|
|
|
OSX := 1
|
2011-02-04 22:53:33 +00:00
|
|
|
LIBS += -framework AppKit
|
2011-02-04 21:47:37 +00:00
|
|
|
else
|
|
|
|
OSX := 0
|
|
|
|
endif
|
|
|
|
|
2011-01-07 10:09:56 +00:00
|
|
|
ifeq ($(HAVE_SRC), 1)
|
|
|
|
LIBS += $(SRC_LIBS)
|
|
|
|
DEFINES += $(SRC_CFLAGS)
|
2011-02-06 12:29:48 +00:00
|
|
|
else
|
|
|
|
OBJ += audio/hermite.o
|
2011-01-07 10:09:56 +00:00
|
|
|
endif
|
|
|
|
|
2011-01-19 11:54:19 +00:00
|
|
|
ifeq ($(HAVE_CONFIGFILE), 1)
|
|
|
|
OBJ += conf/config_file.o
|
|
|
|
endif
|
|
|
|
|
2011-03-19 19:41:07 +00:00
|
|
|
ifeq ($(HAVE_NETPLAY), 1)
|
|
|
|
OBJ += netplay.o
|
|
|
|
endif
|
|
|
|
|
2010-12-30 01:56:56 +00:00
|
|
|
ifeq ($(HAVE_RSOUND), 1)
|
2010-12-24 01:18:39 +00:00
|
|
|
OBJ += audio/rsound.o
|
2010-05-28 12:04:50 +00:00
|
|
|
LIBS += -lrsound
|
|
|
|
endif
|
2011-01-07 10:09:56 +00:00
|
|
|
|
2010-12-30 01:56:56 +00:00
|
|
|
ifeq ($(HAVE_OSS), 1)
|
2010-12-24 01:18:39 +00:00
|
|
|
OBJ += audio/oss.o
|
2010-05-28 12:33:18 +00:00
|
|
|
endif
|
2010-12-30 01:56:56 +00:00
|
|
|
ifeq ($(HAVE_ALSA), 1)
|
2010-12-24 01:18:39 +00:00
|
|
|
OBJ += audio/alsa.o
|
2010-05-28 13:41:38 +00:00
|
|
|
LIBS += -lasound
|
|
|
|
endif
|
2010-12-30 01:56:56 +00:00
|
|
|
ifeq ($(HAVE_ROAR), 1)
|
2010-12-24 01:18:39 +00:00
|
|
|
OBJ += audio/roar.o
|
2010-08-16 19:20:07 +00:00
|
|
|
LIBS += -lroar
|
|
|
|
endif
|
2010-12-30 01:56:56 +00:00
|
|
|
ifeq ($(HAVE_AL), 1)
|
2010-12-24 01:18:39 +00:00
|
|
|
OBJ += audio/openal.o
|
2011-02-04 21:47:37 +00:00
|
|
|
ifeq ($(OSX),1)
|
2011-02-04 13:42:26 +00:00
|
|
|
LIBS += -framework OpenAL
|
|
|
|
else
|
2010-08-25 20:40:43 +00:00
|
|
|
LIBS += -lopenal
|
|
|
|
endif
|
2011-02-04 13:42:26 +00:00
|
|
|
endif
|
2011-01-01 02:53:30 +00:00
|
|
|
ifeq ($(HAVE_JACK),1)
|
|
|
|
OBJ += audio/jack.o
|
2011-03-13 17:09:27 +00:00
|
|
|
LIBS += $(JACK_LIBS)
|
|
|
|
DEFINES += $(JACK_CFLAGS)
|
2011-01-01 02:53:30 +00:00
|
|
|
endif
|
2011-01-29 00:15:09 +00:00
|
|
|
ifeq ($(HAVE_PULSE), 1)
|
|
|
|
OBJ += audio/pulse.o
|
|
|
|
LIBS += $(PULSE_LIBS)
|
|
|
|
DEFINES += $(PULSE_CFLAGS)
|
|
|
|
endif
|
2010-05-28 12:04:50 +00:00
|
|
|
|
2011-01-06 17:34:11 +00:00
|
|
|
ifeq ($(HAVE_SDL), 1)
|
2011-01-07 14:50:16 +00:00
|
|
|
OBJ += gfx/gl.o input/sdl.o audio/sdl.o audio/buffer.o
|
2011-01-06 17:34:11 +00:00
|
|
|
DEFINES += $(SDL_CFLAGS)
|
2011-02-04 12:46:51 +00:00
|
|
|
LIBS += $(SDL_LIBS)
|
2011-02-04 21:47:37 +00:00
|
|
|
ifeq ($(OSX),1)
|
2011-02-04 12:46:51 +00:00
|
|
|
LIBS += -framework OpenGL
|
|
|
|
else
|
|
|
|
LIBS += -lGL
|
|
|
|
endif
|
2010-05-28 12:04:50 +00:00
|
|
|
endif
|
2010-11-12 22:09:43 +00:00
|
|
|
|
2011-03-23 22:48:13 +00:00
|
|
|
ifeq ($(HAVE_FBO), 1)
|
|
|
|
DEFINES += -DHAVE_FBO
|
|
|
|
endif
|
|
|
|
|
2011-03-13 03:51:09 +00:00
|
|
|
ifeq ($(HAVE_XVIDEO), 1)
|
|
|
|
OBJ += gfx/xvideo.o input/x11_input.o
|
|
|
|
LIBS += -lXv -lX11
|
|
|
|
endif
|
|
|
|
|
2010-12-30 01:56:56 +00:00
|
|
|
ifeq ($(HAVE_CG), 1)
|
2011-01-05 16:22:12 +00:00
|
|
|
OBJ += gfx/shader_cg.o
|
2010-11-12 22:09:43 +00:00
|
|
|
LIBS += -lCg -lCgGL
|
|
|
|
endif
|
|
|
|
|
2011-01-05 16:42:58 +00:00
|
|
|
ifeq ($(HAVE_XML), 1)
|
|
|
|
OBJ += gfx/shader_glsl.o
|
|
|
|
LIBS += $(XML_LIBS)
|
|
|
|
DEFINES += $(XML_CFLAGS)
|
|
|
|
endif
|
|
|
|
|
2010-12-30 01:56:56 +00:00
|
|
|
ifeq ($(HAVE_FILTER), 1)
|
2011-03-07 18:12:14 +00:00
|
|
|
LIBS += -ldl
|
2010-05-29 14:59:57 +00:00
|
|
|
endif
|
2010-05-28 12:04:50 +00:00
|
|
|
|
2011-01-22 23:27:20 +00:00
|
|
|
ifeq ($(HAVE_FREETYPE), 1)
|
|
|
|
OBJ += gfx/fonts.o
|
|
|
|
LIBS += $(FREETYPE_LIBS)
|
|
|
|
DEFINES += $(FREETYPE_CFLAGS)
|
|
|
|
endif
|
|
|
|
|
2011-01-05 18:51:19 +00:00
|
|
|
ifeq ($(HAVE_FFMPEG), 1)
|
|
|
|
OBJ += record/ffemu.o
|
|
|
|
LIBS += $(AVCODEC_LIBS) $(AVCORE_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS)
|
|
|
|
DEFINES += $(AVCODEC_CFLAGS) $(AVCORE_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS)
|
|
|
|
endif
|
|
|
|
|
2010-12-30 13:26:12 +00:00
|
|
|
ifeq ($(HAVE_DYNAMIC), 1)
|
2010-12-30 12:54:49 +00:00
|
|
|
LIBS += -ldl
|
2010-12-30 13:26:12 +00:00
|
|
|
else
|
|
|
|
LIBS += $(libsnes)
|
2010-12-30 12:54:49 +00:00
|
|
|
endif
|
|
|
|
|
2011-04-03 20:16:59 +00:00
|
|
|
ifeq ($(HAVE_STRL), 1)
|
|
|
|
DEFINES += -DHAVE_STRL
|
|
|
|
endif
|
|
|
|
|
2011-01-10 16:15:27 +00:00
|
|
|
ifneq ($(V),1)
|
|
|
|
Q := @
|
|
|
|
endif
|
|
|
|
|
2011-03-16 20:48:44 +00:00
|
|
|
CFLAGS += -Wall -O3 -g -I.
|
|
|
|
ifneq ($(findstring icc,$(CC)),)
|
|
|
|
CFLAGS += -std=c99
|
|
|
|
else
|
|
|
|
CFLAGS += -std=gnu99
|
|
|
|
endif
|
2010-05-26 19:27:37 +00:00
|
|
|
|
2010-12-30 01:56:56 +00:00
|
|
|
all: $(TARGET) config.mk
|
|
|
|
|
|
|
|
config.mk: configure qb/*
|
|
|
|
@echo "config.mk is outdated or non-existing. Run ./configure again."
|
2010-12-30 02:23:12 +00:00
|
|
|
@exit 1
|
2010-05-28 12:04:50 +00:00
|
|
|
|
2010-06-27 13:46:23 +00:00
|
|
|
ssnes: $(OBJ)
|
2011-01-10 16:15:27 +00:00
|
|
|
$(Q)$(CXX) -o $@ $(OBJ) $(LIBS) $(LDFLAGS)
|
|
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
2010-06-27 13:46:23 +00:00
|
|
|
|
2011-01-09 14:58:49 +00:00
|
|
|
tools/ssnes-joyconfig: $(JOYCONFIG_OBJ)
|
2011-01-10 16:15:27 +00:00
|
|
|
$(Q)$(CC) -o $@ $(JOYCONFIG_OBJ) $(SDL_LIBS) $(LDFLAGS)
|
|
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
2011-01-09 14:58:49 +00:00
|
|
|
|
2011-01-10 14:01:34 +00:00
|
|
|
%.o: %.c config.h config.mk $(HEADERS)
|
2011-01-10 16:15:27 +00:00
|
|
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
|
|
|
@$(if $(Q), $(shell echo echo CC $<),)
|
2010-05-28 12:04:50 +00:00
|
|
|
|
|
|
|
install: $(TARGET)
|
2011-01-25 09:47:22 +00:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
|
|
mkdir -p $(DESTDIR)/etc
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
|
2011-01-05 19:47:31 +00:00
|
|
|
install -m755 $(TARGET) $(DESTDIR)$(PREFIX)/bin
|
2010-12-30 04:51:11 +00:00
|
|
|
install -m644 ssnes.cfg $(DESTDIR)/etc/ssnes.cfg
|
2011-02-07 10:17:25 +00:00
|
|
|
install -m644 docs/ssnes.1 $(DESTDIR)$(PREFIX)/share/man/man1
|
|
|
|
install -m644 docs/ssnes-joyconfig.1 $(DESTDIR)$(PREFIX)/share/man/man1
|
2011-03-20 21:48:13 +00:00
|
|
|
install -m755 ssnes-zip $(DESTDIR)$(PREFIX)/bin
|
2010-05-28 12:04:50 +00:00
|
|
|
|
2011-01-09 14:58:49 +00:00
|
|
|
uninstall:
|
2011-03-20 21:48:13 +00:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/{ssnes,ssnes-joyconfig,ssnes-zip}
|
2011-01-09 14:58:49 +00:00
|
|
|
rm -f $(DESTDIR)/etc/ssnes.cfg
|
2011-01-15 15:51:20 +00:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/{ssnes,ssnes-joyconfig}.1
|
2010-05-26 19:27:37 +00:00
|
|
|
|
|
|
|
clean:
|
2010-08-19 18:29:32 +00:00
|
|
|
rm -f *.o
|
2010-12-24 10:53:43 +00:00
|
|
|
rm -f audio/*.o
|
2010-12-29 18:43:17 +00:00
|
|
|
rm -f conf/*.o
|
2010-12-24 10:53:43 +00:00
|
|
|
rm -f gfx/*.o
|
2011-01-06 17:34:11 +00:00
|
|
|
rm -f record/*.o
|
2010-08-19 18:29:32 +00:00
|
|
|
rm -f hqflt/*.o
|
2010-08-28 14:36:15 +00:00
|
|
|
rm -f hqflt/snes_ntsc/*.o
|
2011-01-10 16:20:08 +00:00
|
|
|
rm -f input/*.o
|
2011-01-09 14:58:49 +00:00
|
|
|
rm -f tools/*.o
|
2010-08-19 18:29:32 +00:00
|
|
|
rm -f $(TARGET)
|
2010-06-27 13:46:23 +00:00
|
|
|
|
|
|
|
.PHONY: all install uninstall clean
|