RetroArch/Makefile.win

355 lines
8.0 KiB
Makefile
Raw Normal View History

2012-04-21 23:11:18 +02:00
TARGET = retroarch.exe
JTARGET = tools/retroarch-joyconfig.exe
2012-06-20 00:43:41 +02:00
OBJDIR := obj-w32
OBJ = frontend/frontend.o \
frontend/frontend_context.o \
frontend/platform/platform_null.o \
retroarch.o \
2012-06-20 00:43:41 +02:00
file.o \
file_path.o \
driver.o \
conf/config_file.o \
settings.o \
settings_data.o \
2012-06-20 00:43:41 +02:00
hash.o \
dynamic.o \
2013-04-14 16:24:19 +02:00
dynamic_dummy.o \
message_queue.o \
2012-06-20 00:43:41 +02:00
rewind.o \
movie.o \
gfx/gfx_common.o \
2012-09-28 22:38:42 +02:00
input/input_common.o \
input/keyboard_line.o \
input/autoconf/builtin_win.o \
2013-04-04 13:58:30 +02:00
core_options.o \
2012-06-20 00:43:41 +02:00
patch.o \
compat/compat.o \
screenshot.o \
cheats.o \
2014-03-01 11:53:04 +01:00
frontend/info/core_info.o \
2012-06-20 00:43:41 +02:00
audio/utils.o \
2012-12-20 15:53:09 +01:00
input/overlay.o \
2012-09-30 11:26:26 +02:00
fifo_buffer.o \
media/rarch.o \
gfx/context/win32_common.o \
gfx/scaler/scaler.o \
gfx/shader_common.o \
gfx/scaler/pixconv.o \
gfx/scaler/scaler_int.o \
gfx/scaler/scaler_filter.o \
gfx/state_tracker.o \
gfx/shader_parse.o \
gfx/fonts/fonts.o \
gfx/fonts/bitmapfont.o \
gfx/image/image_rpng.o \
2013-02-08 11:49:51 +01:00
audio/resampler.o \
2014-05-20 12:28:33 +02:00
audio/dsp_filter.o \
audio/sinc.o \
audio/cc_resampler.o \
performance.o
2012-06-20 00:43:41 +02:00
JOBJ := conf/config_file.o \
tools/retroarch-joyconfig.o \
compat/compat.o \
2012-11-18 17:42:03 +01:00
file_path.o \
2013-04-26 15:10:52 +02:00
tools/input_common_joyconfig.o \
2013-08-23 13:09:59 +01:00
input/dinput.o \
input/winxinput_joypad.o
2011-01-07 17:59:53 +01:00
2014-01-11 19:08:24 +01:00
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
2014-02-02 15:34:37 +01:00
ifneq ($(HOST_PREFIX),)
CC = $(HOST_PREFIX)gcc
CXX = $(HOST_PREFIX)g++
WINDRES = $(HOST_PREFIX)windres
else
CC = gcc
CXX = g++
WINDRES = windres
endif
2011-01-07 17:59:53 +01:00
2011-06-10 16:55:05 +02:00
HAVE_DINPUT = 1
HAVE_XAUDIO = 1
HAVE_DSOUND = 1
2011-11-02 17:02:59 +01:00
HAVE_OPENGL = 1
2013-07-25 16:33:06 +02:00
HAVE_FBO = 1
2011-05-11 17:52:16 +02:00
HAVE_DYLIB = 1
2012-11-04 00:48:13 +01:00
HAVE_D3D9 = 1
2011-08-28 22:43:50 +02:00
HAVE_NETPLAY = 1
2012-08-07 21:31:43 +02:00
HAVE_STDIN_CMD = 1
2011-11-30 17:46:58 +01:00
HAVE_THREADS = 1
2013-03-17 13:24:09 +01:00
HAVE_RGUI = 1
DYNAMIC = 1
2011-08-28 21:47:58 +02:00
2013-08-26 12:13:41 +01:00
HAVE_WINXINPUT = 1
2013-08-23 13:09:59 +01:00
2011-08-28 21:47:58 +02:00
ifeq ($(SLIM),)
2012-09-30 11:26:26 +02:00
HAVE_SDL = 1
HAVE_LIBXML2 = 1
2011-08-28 21:47:58 +02:00
HAVE_FREETYPE = 1
HAVE_ZLIB = 1
2011-08-28 21:47:58 +02:00
HAVE_RSOUND = 1
HAVE_CG = 1
HAVE_PYTHON = 1
HAVE_FFMPEG = 1
2011-08-28 21:47:58 +02:00
endif
2012-04-22 12:17:22 +02:00
libretro ?= -lretro
2011-01-07 17:59:53 +01:00
2012-01-05 17:41:04 +01:00
LIBS = -lm
DEFINES = -I. -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE -DHAVE_BUILTIN_AUTOCONFIG -DRARCH_INTERNAL -DHAVE_CC_RESAMPLER -DHAVE_OVERLAY
2011-11-15 15:41:49 +01:00
LDFLAGS = -L. -static-libgcc
ifeq ($(TDM_GCC),)
LDCXXFLAGS += -static-libstdc++
endif
2011-01-07 17:59:53 +01:00
2012-09-30 11:26:26 +02:00
ifeq ($(SCALER_NO_SIMD), 1)
DEFINES += -DSCALER_NO_SIMD
endif
2012-10-11 22:36:11 +02:00
JLIBS =
2013-03-17 13:24:09 +01:00
ifeq ($(HAVE_RGUI), 1)
DEFINES += -DHAVE_RGUI -DHAVE_MENU
OBJ += frontend/menu/disp/rgui.o
2014-04-26 11:04:34 +02:00
HAVE_MENU_COMMON = 1
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += frontend/menu/backend/menu_common_backend.o frontend/menu/menu_input_line_cb.o frontend/menu/menu_common.o frontend/menu/menu_navigation.o frontend/menu/file_list.o frontend/menu/history.o
2013-03-17 13:24:09 +01:00
endif
2012-09-30 11:26:26 +02:00
ifeq ($(HAVE_SDL), 1)
OBJ += gfx/sdl_gfx.o input/sdl_input.o input/sdl_joypad.o audio/sdl_audio.o
2012-09-30 11:26:26 +02:00
JOBJ += input/sdl_joypad.o
2011-11-02 17:04:49 +01:00
LIBS += -lSDL
2012-10-11 22:36:11 +02:00
JLIBS += -lSDL
DEFINES += -ISDL -DHAVE_SDL
endif
2011-11-30 17:46:58 +01:00
ifeq ($(HAVE_THREADS), 1)
2013-12-31 22:10:58 +01:00
OBJ += autosave.o thread.o gfx/video_thread_wrapper.o audio/thread_wrapper.o
2011-11-30 17:46:58 +01:00
DEFINES += -DHAVE_THREADS
endif
2011-11-02 17:04:49 +01:00
ifeq ($(HAVE_OPENGL), 1)
2013-07-05 18:28:08 +02:00
OBJ += gfx/gl.o gfx/math/matrix.o gfx/fonts/gl_font.o gfx/fonts/gl_raster_font.o gfx/gfx_context.o gfx/context/wgl_ctx.o gfx/shader_glsl.o gfx/glsym/rglgen.o gfx/glsym/glsym_gl.o
DEFINES += -DHAVE_OPENGL -DHAVE_GLSL -DHAVE_GL_SYNC
LIBS += -lopengl32 -lgdi32 -lcomdlg32
2011-11-02 17:04:49 +01:00
endif
2011-05-18 22:40:42 +02:00
ifeq ($(HAVE_CG), 1)
OBJ += gfx/shader_cg.o
LIBS += -lcg -lcgGL
DEFINES += -DHAVE_CG
2012-10-26 21:09:30 +02:00
else
HAVE_D3D9 = 0
endif
ifeq ($(HAVE_D3D9), 1)
2014-03-09 15:49:20 +01:00
OBJ += gfx/d3d9/d3d.o gfx/d3d9/render_chain.o gfx/fonts/d3d_font.o gfx/fonts/d3d_w32_font.o gfx/context/d3d_ctx.o
2012-10-26 21:09:30 +02:00
DEFINES += -DHAVE_WIN32_D3D9
LIBS += -ld3d9 -lcg -lcgD3D9 -ld3dx9 -ldxguid
2011-05-18 22:40:42 +02:00
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
2013-01-22 00:03:22 +01:00
ifeq ($(HAVE_ZLIB), 1)
OBJ += gfx/rpng/rpng.o file_extract.o
2013-03-28 15:05:12 +01:00
DEFINES += -DHAVE_ZLIB
ifeq ($(WANT_MINIZ), 1)
OBJ += deps/miniz/miniz.o
DEFINES += -DWANT_MINIZ
else
LIBS += -lz
DEFINES += -DHAVE_ZLIB_DEFLATE
endif
2013-01-22 00:03:22 +01:00
endif
ifeq ($(HAVE_LIBXML2), 1)
DEFINES += -Ilibxml2 -DHAVE_LIBXML2 -DHAVE_GLSL
2011-08-28 22:20:15 +02:00
LIBS += -lxml2 -liconv
else
OBJ += compat/rxml/rxml.o
2011-01-07 17:59:53 +01:00
endif
2011-05-11 17:52:16 +02:00
ifeq ($(HAVE_DYLIB), 1)
DEFINES += -DHAVE_DYLIB
OBJ += gfx/filter.o
2011-03-07 20:22:55 +01:00
endif
2012-08-07 21:31:43 +02:00
ifeq ($(HAVE_STDIN_CMD), 1)
DEFINES += -DHAVE_COMMAND -DHAVE_STDIN_CMD
OBJ += command.o
endif
2011-03-19 20:42:49 +01:00
ifeq ($(HAVE_NETPLAY), 1)
2012-08-07 21:31:43 +02:00
DEFINES += -DHAVE_NETPLAY -DHAVE_NETWORK_CMD
OBJ += netplay.o
2011-03-19 20:42:49 +01:00
LIBS += -lws2_32
endif
2011-01-24 21:46:43 +01:00
ifeq ($(HAVE_FREETYPE), 1)
OBJ += gfx/fonts/freetype.o
2011-01-24 21:46:43 +01:00
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
2012-04-22 12:17:22 +02:00
LIBS += $(libretro)
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-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
2013-08-26 12:13:41 +01:00
ifeq ($(HAVE_WINXINPUT), 1)
DEFINES += -DHAVE_WINXINPUT
2013-08-23 13:09:59 +01:00
OBJ += input/winxinput_joypad.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)
2012-11-23 23:29:28 +01:00
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
DEFINES += -DHAVE_FFMPEG -DHAVE_RECORD -Iffmpeg
2014-05-04 11:52:09 +02:00
OBJ += record/ffemu.o record/ffmpeg.o
2011-06-14 23:59:00 +02:00
endif
2011-12-24 13:46:12 +01:00
ifneq ($(V), 1)
2011-01-10 17:15:27 +01:00
Q := @
endif
2012-06-17 00:18:23 +02:00
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
2012-06-17 00:18:23 +02:00
else
CFLAGS += -O3 -ffast-math
CXXFLAGS += -O3 -ffast-math
2012-06-17 00:18:23 +02:00
LDCXXFLAGS += -s
endif
ifeq ($(GL_DEBUG), 1)
CFLAGS += -DGL_DEBUG
CXXFLAGS += -DGL_DEBUG
endif
2013-03-17 13:24:09 +01: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 13:46:12 +01:00
ifeq ($(CXX_BUILD), 1)
2011-12-25 01:45:09 +01:00
CFLAGS += -std=c++0x -xc++ -D__STDC_CONSTANT_MACROS
2011-12-24 13:46:12 +01:00
else
ifneq ($(GNU90_BUILD), 1)
CFLAGS += -std=gnu99
endif
2011-12-24 13:46:12 +01:00
endif
2011-01-07 17:59:53 +01:00
2014-01-11 19:05:26 +01:00
GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null)
ifneq ($(GIT_VERSION),)
DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=\"$(GIT_VERSION)\"
OBJ += git_version.o
endif
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
RARCH_JOBJ := $(addprefix $(OBJDIR)/,$(JOBJ))
2011-01-24 22:15:49 +01:00
all: $(TARGET) $(JTARGET)
2011-01-07 17:59:53 +01:00
-include $(RARCH_OBJ:.o=.d) $(RARCH_JOBJ:.o=.d)
$(TARGET): $(RARCH_OBJ)
2011-01-10 17:15:27 +01:00
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(CXX) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
2011-01-09 16:08:06 +01: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 17:15:27 +01:00
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
2011-01-09 19:50:23 +01:00
$(OBJDIR)/tools/input_common_joyconfig.o: input/input_common.c
@mkdir -p $(dir $@)
2013-04-26 15:10:52 +02:00
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -MMD -c -o $@ $<
2013-04-26 15:10:52 +02:00
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
2012-10-26 21:09:30 +02:00
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
2012-10-26 21:09:30 +02:00
$(OBJDIR)/%.o: %.rc $(HEADERS)
@mkdir -p $(dir $@)
2012-10-11 00:09:24 +02:00
@$(if $(Q), $(shell echo echo WINDRES $<),)
2013-01-04 21:56:15 +01:00
$(Q)$(WINDRES) -o $@ $<
2012-10-11 00:09:24 +02:00
$(JTARGET): $(RARCH_JOBJ)
2013-01-04 21:56:15 +01:00
@$(if $(Q), $(shell echo echo LD $@),)
2011-12-24 13:46:12 +01:00
ifeq ($(CXX_BUILD), 1)
$(Q)$(CXX) -o $@ $(RARCH_JOBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JLIBS)
2011-12-24 13:46:12 +01:00
else
$(Q)$(CC) -o $@ $(RARCH_JOBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JLIBS)
2011-12-24 13:46:12 +01:00
endif
2011-01-09 17:24:13 +01:00
2011-01-07 17:59:53 +01:00
clean:
rm -rf $(OBJDIR)
2011-01-07 17:59:53 +01:00
rm -f $(TARGET)
rm -f tools/retroarch-joyconfig.exe
2011-01-07 17:59:53 +01:00
dist_x86: all
2014-01-02 22:57:44 +01:00
zip -r retroarch-win32-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
dist_x86_64: all
2014-01-02 22:57:44 +01:00
zip -r retroarch-win64-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
2011-01-24 21:46:43 +01:00
libs_x86:
2013-08-11 00:36:03 +02:00
wget http://themaister.net/retroarch-dl/RetroArch-win32-libs.zip
2012-04-21 23:50:46 +02:00
unzip RetroArch-win32-libs.zip
2013-08-11 00:36:03 +02:00
wget http://themaister.net/retroarch-dl/RetroArch-win32-headers.zip
2012-04-21 23:50:46 +02:00
unzip RetroArch-win32-headers.zip
2011-01-08 20:05:41 +01:00
libs_x86_64:
2013-08-11 00:36:03 +02:00
wget http://themaister.net/retroarch-dl/RetroArch-win64-libs.zip
2012-04-21 23:50:46 +02:00
unzip RetroArch-win64-libs.zip
2013-08-11 00:36:03 +02:00
wget http://themaister.net/retroarch-dl/RetroArch-win64-headers.zip
2012-04-21 23:50:46 +02:00
unzip RetroArch-win64-headers.zip
.PHONY: all install uninstall clean dist_x86 dist_x86_64 libs_x86 libs_x86_64
2012-04-21 23:50:46 +02:00