RetroArch/Makefile.win

205 lines
4.5 KiB
Makefile
Raw Normal View History

2012-04-21 21:11:18 +00:00
TARGET = retroarch.exe
JTARGET = tools/retroarch-joyconfig.exe
2012-06-19 22:43:41 +00:00
2011-06-10 14:55:05 +00:00
HAVE_DINPUT = 1
HAVE_XAUDIO = 1
HAVE_DSOUND = 1
2011-11-02 16:02:59 +00:00
HAVE_OPENGL = 1
2013-07-25 14:33:06 +00:00
HAVE_FBO = 1
2011-05-11 15:52:16 +00:00
HAVE_DYLIB = 1
2012-11-03 23:48:13 +00:00
HAVE_D3D9 = 1
2011-08-28 20:43:50 +00:00
HAVE_NETPLAY = 1
HAVE_NETWORKING = 1
2012-08-07 19:31:43 +00:00
HAVE_STDIN_CMD = 1
2014-09-14 17:53:44 +00:00
HAVE_COMMAND = 1
2011-11-30 16:46:58 +00:00
HAVE_THREADS = 1
2013-03-17 12:24:09 +00:00
HAVE_RGUI = 1
2014-09-12 01:33:45 +00:00
HAVE_GLUI = 1
HAVE_7ZIP = 1
2014-11-10 19:28:06 +00:00
HAVE_ZLIB_DEFLATE = 1
HAVE_PYTHON = 0
DYNAMIC = 1
2011-08-28 19:47:58 +00:00
2015-04-05 18:54:46 +00:00
HAVE_XINPUT = 1
2013-08-23 12:09:59 +00:00
HAVE_SDL := 0
HAVE_SDL2 := 0
HAVE_RSOUND := 0
HAVE_PYTHON := 0
HAVE_FREETYPE := 1
HAVE_FFMPEG := 0
HAVE_CG := 1
HAVE_LIBXML2 := 0
HAVE_ZLIB := 1
2015-03-14 04:24:57 +00:00
WANT_ZLIB := 1
2011-08-28 19:47:58 +00:00
ifeq ($(HAVE_CG), 1)
2014-09-16 20:45:45 +00:00
CG_LIBS := -lcg -lcgGL
endif
2014-09-16 20:45:45 +00:00
ifeq ($(HAVE_FREETYPE), 1)
2014-09-14 01:22:04 +00:00
FREETYPE_CFLAGS := -DHAVE_FREETYPE -Ifreetype2
FREETYPE_LIBS := -lfreetype
endif
2014-09-13 23:01:52 +00:00
ifeq ($(HAVE_LIBXML2), 1)
2014-09-14 01:22:04 +00:00
LIBXML2_CFLAGS := -Ilibxml2 -DHAVE_LIBXML2 -DHAVE_GLSL
LIBXML2_LIBS := -lxml2 -liconv
endif
2014-09-14 00:52:30 +00:00
ifeq ($(HAVE_SDL), 1)
2014-09-14 01:22:04 +00:00
SDL_LIBS := -lSDL
SDL_CFLAGS := -ISDL -DHAVE_SDL
BSD_LOCAL_INC :=
endif
2014-09-14 00:52:30 +00:00
ifeq ($(HAVE_SDL2), 1)
2014-09-14 01:22:04 +00:00
SDL2_LIBS := -lSDL2
SDL2_CFLAGS := -ISDL2 -DHAVE_SDL2
endif
2014-09-14 00:15:41 +00:00
ifeq ($(HAVE_RSOUND), 1)
2014-09-14 01:22:04 +00:00
RSOUND_CFLAGS := -DHAVE_RSOUND
RSOUND_LIBS := -lrsound
endif
2014-09-14 01:22:04 +00:00
ifeq ($(HAVE_PYTHON), 1)
2014-09-14 01:22:04 +00:00
PYTHON_LIBS := -lpython32
PYTHON_CFLAGS := -DHAVE_PYTHON -Ipython
endif
2014-09-14 01:22:04 +00:00
ifeq ($(HAVE_FFMPEG), 1)
2014-09-14 02:43:18 +00:00
AVCODEC_LIBS := -lavcodec
AVUTIL_LIBS := -lavutil
SWSCALE_LIBS := -lswscale
AVFORMAT_LIBS := -lavformat
SWRESAMPLE_LIBS := -lswresample
2014-09-14 02:43:18 +00:00
FFMPEG_LIBS := -lws2_32 -lz
endif
2014-09-14 02:43:18 +00:00
2014-09-14 01:22:04 +00:00
OBJDIR := obj-w32
2014-09-14 01:50:38 +00:00
OS := Win32
2014-09-13 22:55:17 +00:00
OBJ :=
2014-09-14 01:58:49 +00:00
JOYCONFIG_OBJ :=
2014-09-13 22:55:17 +00:00
LIBS := -lm
JOYCONFIG_LIBS :=
DEFINES := -I. -Ilibretro-common/include -DRARCH_INTERNAL -DHAVE_OVERLAY
2014-09-13 22:55:17 +00:00
LDFLAGS := -L. -static-libgcc
include Makefile.common
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
ifneq ($(HOST_PREFIX),)
CC = $(HOST_PREFIX)gcc
CXX = $(HOST_PREFIX)g++
WINDRES = $(HOST_PREFIX)windres
else
CC = gcc
CXX = g++
WINDRES = windres
endif
2012-04-22 10:17:22 +00:00
libretro ?= -lretro
2011-01-07 16:59:53 +00:00
2011-01-19 12:25:18 +00:00
ifeq ($(DYNAMIC), 1)
DEFINES += -DHAVE_DYNAMIC
else
2012-04-22 10:17:22 +00:00
LIBS += $(libretro)
2011-01-19 12:25:18 +00:00
endif
2011-12-24 12:46:12 +00:00
ifneq ($(V), 1)
2011-01-10 16:15:27 +00:00
Q := @
endif
2012-06-16 22:18:23 +00:00
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
2012-06-16 22:18:23 +00:00
else
CFLAGS += -O3 -ffast-math
CXXFLAGS += -O3 -ffast-math
2012-06-16 22:18:23 +00:00
LDCXXFLAGS += -s
endif
2013-03-17 12:24:09 +00:00
CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I.
CXXFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -std=c++0x -D__STDC_CONSTANT_MACROS
2011-12-24 12:46:12 +00:00
ifeq ($(CXX_BUILD), 1)
2011-12-25 00:45:09 +00:00
CFLAGS += -std=c++0x -xc++ -D__STDC_CONSTANT_MACROS
2011-12-24 12:46:12 +00:00
else
ifneq ($(GNU90_BUILD), 1)
CFLAGS += -std=gnu99
endif
2011-12-24 12:46:12 +00:00
endif
2011-01-07 16:59:53 +00:00
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
RARCH_JOYCONFIG_OBJ := $(addprefix $(OBJDIR)/,$(JOYCONFIG_OBJ))
2011-01-24 21:15:49 +00:00
all: $(TARGET) $(JTARGET)
2011-01-07 16:59:53 +00:00
-include $(RARCH_OBJ:.o=.d) $(RARCH_JOYCONFIG_OBJ:.o=.d)
$(TARGET): $(RARCH_OBJ)
2011-01-10 16:15:27 +00:00
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(CXX) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
2011-01-09 15:08:06 +00:00
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
.FORCE:
$(OBJDIR)/git_version.o: git_version.c .FORCE
@mkdir -p $(dir $@)
2011-01-10 16:15:27 +00:00
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
2011-01-09 18:50:23 +00:00
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
2012-10-26 19:09:30 +00:00
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
2012-10-26 19:09:30 +00:00
$(OBJDIR)/%.o: %.rc $(HEADERS)
@mkdir -p $(dir $@)
2012-10-10 22:09:24 +00:00
@$(if $(Q), $(shell echo echo WINDRES $<),)
2013-01-04 20:56:15 +00:00
$(Q)$(WINDRES) -o $@ $<
2012-10-10 22:09:24 +00:00
$(JTARGET): $(RARCH_JOYCONFIG_OBJ)
2013-01-04 20:56:15 +00:00
@$(if $(Q), $(shell echo echo LD $@),)
2011-12-24 12:46:12 +00:00
ifeq ($(CXX_BUILD), 1)
$(Q)$(CXX) -o $@ $(RARCH_JOYCONFIG_OBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JOYCONFIG_LIBS)
2011-12-24 12:46:12 +00:00
else
$(Q)$(CC) -o $@ $(RARCH_JOYCONFIG_OBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JOYCONFIG_LIBS)
2011-12-24 12:46:12 +00:00
endif
2011-01-09 16:24:13 +00:00
2011-01-07 16:59:53 +00:00
clean:
rm -rf $(OBJDIR)
2011-01-07 16:59:53 +00:00
rm -f $(TARGET)
rm -f *.d
rm -f tools/retroarch-joyconfig.exe
2011-01-07 16:59:53 +00:00
dist_x86: all
2014-01-02 21:57:44 +00:00
zip -r retroarch-win32-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
dist_x86_64: all
2014-01-02 21:57:44 +00:00
zip -r retroarch-win64-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
2011-01-24 20:46:43 +00:00
libs_x86:
2013-08-10 22:36:03 +00:00
wget http://themaister.net/retroarch-dl/RetroArch-win32-libs.zip
2012-04-21 21:50:46 +00:00
unzip RetroArch-win32-libs.zip
2013-08-10 22:36:03 +00:00
wget http://themaister.net/retroarch-dl/RetroArch-win32-headers.zip
2012-04-21 21:50:46 +00:00
unzip RetroArch-win32-headers.zip
2011-01-08 19:05:41 +00:00
libs_x86_64:
2013-08-10 22:36:03 +00:00
wget http://themaister.net/retroarch-dl/RetroArch-win64-libs.zip
2012-04-21 21:50:46 +00:00
unzip RetroArch-win64-libs.zip
2013-08-10 22:36:03 +00:00
wget http://themaister.net/retroarch-dl/RetroArch-win64-headers.zip
2012-04-21 21:50:46 +00:00
unzip RetroArch-win64-headers.zip
.PHONY: all install uninstall clean dist_x86 dist_x86_64 libs_x86 libs_x86_64
2012-04-21 21:50:46 +00:00