RetroArch/Makefile.win

298 lines
6.1 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
OBJ = retroarch.o \
file.o \
file_path.o \
driver.o \
conf/config_file.o \
settings.o \
hash.o \
dynamic.o \
message.o \
rewind.o \
movie.o \
gfx/gfx_common.o \
2012-09-28 20:38:42 +00:00
input/input_common.o \
2012-06-19 22:43:41 +00:00
patch.o \
compat/compat.o \
screenshot.o \
audio/utils.o \
audio/null.o \
input/null.o \
2012-09-30 09:26:26 +00:00
fifo_buffer.o \
2012-10-10 22:09:24 +00:00
gfx/null.o \
media/rarch.o \
gfx/scaler/scaler.o \
gfx/scaler/pixconv.o \
gfx/scaler/scaler_int.o \
gfx/scaler/filter.o \
gfx/state_tracker.o \
gfx/fonts/fonts.o \
gfx/fonts/bitmapfont.o \
gfx/image.o \
performance.o
2012-06-19 22:43:41 +00:00
JOBJ := conf/config_file.o \
tools/retroarch-joyconfig.o \
compat/compat.o \
2012-11-18 16:42:03 +00:00
file_path.o \
input/input_common.o \
2012-09-30 09:26:26 +00:00
input/dinput.o
2011-01-07 16:59:53 +00:00
CC = gcc
CXX = g++
2012-10-10 22:09:24 +00:00
WINDRES = windres
2011-01-07 16:59:53 +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
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
2012-08-07 19:31:43 +00:00
HAVE_STDIN_CMD = 1
2011-11-30 16:46:58 +00:00
HAVE_THREADS = 1
HAVE_SINC = 1
DYNAMIC = 1
2011-08-28 19:47:58 +00:00
ifeq ($(SLIM),)
2012-09-30 09:26:26 +00:00
HAVE_SDL = 1
2011-08-28 19:47:58 +00:00
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 19:47:58 +00:00
endif
2012-04-22 10:17:22 +00:00
libretro ?= -lretro
2011-01-07 16:59:53 +00:00
2012-01-05 16:41:04 +00:00
LIBS = -lm
2012-11-25 11:56:25 +00:00
DEFINES = -I. -DHAVE_CONFIGFILE -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE -DPACKAGE_VERSION=\"0.9.8-beta3\"
2011-11-15 14:41:49 +00:00
LDFLAGS = -L. -static-libgcc
ifeq ($(TDM_GCC),)
LDCXXFLAGS += -static-libstdc++
endif
2011-01-07 16:59:53 +00:00
2012-09-30 09:26:26 +00:00
ifeq ($(SCALER_NO_SIMD), 1)
DEFINES += -DSCALER_NO_SIMD
endif
ifeq ($(PERF_TEST), 1)
DEFINES += -DPERF_TEST
endif
2012-10-11 20:36:11 +00:00
JLIBS =
2012-09-30 09:26:26 +00:00
ifeq ($(HAVE_SDL), 1)
OBJ += gfx/sdl_gfx.o gfx/context/sdl_ctx.o input/sdl_input.o input/sdl_joypad.o audio/sdl_audio.o
JOBJ += input/sdl_joypad.o
2011-11-02 16:04:49 +00:00
LIBS += -lSDL
2012-10-11 20:36:11 +00:00
JLIBS += -lSDL
DEFINES += -ISDL -DHAVE_SDL
endif
2011-11-30 16:46:58 +00:00
ifeq ($(HAVE_THREADS), 1)
2011-11-30 17:18:50 +00:00
OBJ += autosave.o thread.o
2011-11-30 16:46:58 +00:00
DEFINES += -DHAVE_THREADS
endif
2011-11-02 16:04:49 +00:00
ifeq ($(HAVE_OPENGL), 1)
OBJ += gfx/gl.o gfx/math/matrix.o gfx/fonts/gl_font.o gfx/gfx_context.o gfx/context/wgl_ctx.o
2011-11-02 16:04:49 +00:00
DEFINES += -DHAVE_OPENGL
2012-09-30 09:26:26 +00:00
LIBS += -lopengl32 -lgdi32
2011-11-02 16:04:49 +00:00
endif
2011-06-11 16:13:12 +00:00
ifeq ($(HAVE_SDL_IMAGE), 1)
LIBS += -lSDL_image
DEFINES += -DHAVE_SDL_IMAGE
endif
2011-05-18 20:40:42 +00:00
ifeq ($(HAVE_CG), 1)
OBJ += gfx/shader_cg.o
LIBS += -lcg -lcgGL
DEFINES += -DHAVE_CG
2012-10-26 19:09:30 +00:00
else
HAVE_D3D9 = 0
endif
ifeq ($(HAVE_D3D9), 1)
OBJ += gfx/d3d9/d3d9.o gfx/d3d9/render_chain.o
DEFINES += -DHAVE_WIN32_D3D9
LIBS += -ld3d9 -lcg -lcgD3D9 -ld3dx9 -ldxguid
2011-05-18 20:40:42 +00: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 22:53:38 +00:00
ifeq ($(HAVE_RSOUND), 1)
OBJ += audio/rsound.o
DEFINES += -DHAVE_RSOUND
LIBS += -lrsound
endif
ifeq ($(HAVE_XML), 1)
OBJ += gfx/shader_glsl.o cheats.o
DEFINES += -Ilibxml2 -DHAVE_XML -DHAVE_GLSL
2011-08-28 20:20:15 +00:00
LIBS += -lxml2 -liconv
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
2012-08-07 19:31:43 +00:00
ifeq ($(HAVE_STDIN_CMD), 1)
DEFINES += -DHAVE_COMMAND -DHAVE_STDIN_CMD
OBJ += command.o
endif
2011-03-19 19:42:49 +00:00
ifeq ($(HAVE_NETPLAY), 1)
2012-08-07 19:31:43 +00:00
DEFINES += -DHAVE_NETPLAY -DHAVE_NETWORK_CMD
OBJ += netplay.o
2011-03-19 19:42:49 +00:00
LIBS += -lws2_32
endif
2011-01-24 20:46:43 +00:00
ifeq ($(HAVE_FREETYPE), 1)
OBJ += gfx/fonts/freetype.o
2011-01-24 20:46:43 +00:00
DEFINES += -DHAVE_FREETYPE -Ifreetype2
2011-08-28 20:19:02 +00:00
LIBS += -lfreetype -lz
2011-01-24 20:46:43 +00:00
endif
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-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)
2011-12-24 23:59:46 +00:00
OBJ += gfx/ext_gfx.o audio/ext_audio.o
2011-05-11 15:52:16 +00:00
endif
2011-06-09 11:56:29 +00:00
ifeq ($(HAVE_PYTHON), 1)
LIBS += -lpython32
DEFINES += -DHAVE_PYTHON -Ipython
OBJ += gfx/py_state/py_state.o
endif
2011-06-10 14:55:05 +00:00
ifeq ($(HAVE_DINPUT), 1)
LIBS += -ldinput8 -ldxguid -lole32
2011-08-19 17:16:53 +00:00
DEFINES += -DHAVE_DINPUT
2011-06-10 14:55:05 +00:00
OBJ += input/dinput.o
endif
2011-06-14 21:59:00 +00:00
ifeq ($(HAVE_FFMPEG), 1)
2012-11-23 22:29:28 +00:00
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
2011-08-19 17:16:53 +00:00
DEFINES += -DHAVE_FFMPEG -Iffmpeg
2011-06-14 21:59:00 +00:00
OBJ += record/ffemu.o
endif
2012-02-23 23:28:41 +00:00
ifeq ($(HAVE_SINC), 1)
OBJ += audio/sinc.o
else
OBJ += audio/hermite.o
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
CXXFLAGS += -O3
2012-06-16 22:18:23 +00:00
LDCXXFLAGS += -s
endif
CFLAGS += -Wall -Wno-unused-result -I.
CXXFLAGS += -Wall -Wno-unused-result -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
CFLAGS += -std=gnu99
endif
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-08-20 01:25:44 +00:00
$(Q)$(CXX) -o $@ $(OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
2011-01-10 16:15:27 +00:00
@$(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
2012-10-26 19:09:30 +00:00
%.o: %.cpp
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -c -o $@ $<
2012-10-26 19:09:30 +00:00
@$(if $(Q), $(shell echo echo CXX $<),)
2012-10-10 22:09:24 +00:00
%.o: %.rc
$(Q)$(WINDRES) -o $@ $<
@$(if $(Q), $(shell echo echo WINDRES $<),)
2011-01-24 21:15:49 +00:00
$(JTARGET): $(JOBJ)
2011-12-24 12:46:12 +00:00
ifeq ($(CXX_BUILD), 1)
2012-10-11 20:36:11 +00:00
$(Q)$(CXX) -o $@ $(JOBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JLIBS)
2011-12-24 12:46:12 +00:00
else
2012-10-11 20:36:11 +00:00
$(Q)$(CC) -o $@ $(JOBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JLIBS)
2011-12-24 12:46:12 +00:00
endif
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 audio/xaudio-c/*.o
2012-06-30 07:25:00 +00:00
rm -f compat/*.o
2011-01-07 16:59:53 +00:00
rm -f conf/*.o
2012-09-02 21:49:30 +00:00
rm -f gfx/scaler/*.o
2011-01-07 16:59:53 +00:00
rm -f gfx/*.o
2012-10-26 19:09:30 +00:00
rm -f gfx/d3d9/*.o
2012-06-10 08:44:08 +00:00
rm -f gfx/context/*.o
2012-09-09 21:37:12 +00:00
rm -f gfx/math/*.o
2012-06-10 08:44:08 +00:00
rm -f gfx/fonts/*.o
2011-06-09 11:56:29 +00:00
rm -f gfx/py_state/*.o
2011-01-07 16:59:53 +00:00
rm -f record/*.o
2011-01-10 16:20:08 +00:00
rm -f input/*.o
2011-01-07 16:59:53 +00:00
rm -f $(TARGET)
2012-04-22 10:17:22 +00:00
rm -f retroarch-joyconfig.exe
2011-01-09 16:24:13 +00:00
rm -f tools/*.o
2011-01-07 16:59:53 +00:00
dist_x86: all
2012-11-25 11:56:25 +00:00
zip -r retroarch-win32-0.9.8-beta3.zip $(TARGET) $(JTARGET) retroarch.cfg
dist_x86_64: all
2012-11-25 11:56:25 +00:00
zip -r retroarch-win64-0.9.8-beta3.zip $(TARGET) $(JTARGET) retroarch.cfg
2011-01-24 20:46:43 +00:00
libs_x86:
2012-04-21 21:50:46 +00:00
wget https://github.com/downloads/Themaister/RetroArch/RetroArch-win32-libs.zip --no-check-certificate
unzip RetroArch-win32-libs.zip
wget https://github.com/downloads/Themaister/RetroArch/RetroArch-win32-headers.zip --no-check-certificate
unzip RetroArch-win32-headers.zip
2011-01-08 19:05:41 +00:00
libs_x86_64:
2012-04-21 21:50:46 +00:00
wget https://github.com/downloads/Themaister/RetroArch/RetroArch-win64-libs.zip --no-check-certificate
unzip RetroArch-win64-libs.zip
wget https://github.com/downloads/Themaister/RetroArch/RetroArch-win64-headers.zip --no-check-certificate
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