2012-04-21 23:11:18 +02:00
|
|
|
TARGET = retroarch.exe
|
2012-06-20 00:43:41 +02:00
|
|
|
|
2011-06-10 16:55:05 +02:00
|
|
|
HAVE_DINPUT = 1
|
2011-01-27 01:46:00 +01:00
|
|
|
HAVE_XAUDIO = 1
|
2011-08-04 18:45:40 +02:00
|
|
|
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
|
2015-01-28 08:58:25 +01:00
|
|
|
HAVE_NETWORKING = 1
|
2012-08-07 21:31:43 +02:00
|
|
|
HAVE_STDIN_CMD = 1
|
2014-09-14 19:53:44 +02:00
|
|
|
HAVE_COMMAND = 1
|
2011-11-30 17:46:58 +01:00
|
|
|
HAVE_THREADS = 1
|
2013-03-17 13:24:09 +01:00
|
|
|
HAVE_RGUI = 1
|
2015-11-02 23:23:54 +01:00
|
|
|
HAVE_MATERIALUI = 1
|
2014-09-02 17:55:45 +02:00
|
|
|
HAVE_7ZIP = 1
|
2014-11-10 13:28:06 -06:00
|
|
|
HAVE_PYTHON = 0
|
2011-10-05 21:44:17 +02:00
|
|
|
DYNAMIC = 1
|
2011-08-28 21:47:58 +02:00
|
|
|
|
2015-04-05 20:54:46 +02:00
|
|
|
HAVE_XINPUT = 1
|
2013-08-23 13:09:59 +01:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
HAVE_SDL := 0
|
|
|
|
HAVE_SDL2 := 0
|
|
|
|
HAVE_RSOUND := 0
|
|
|
|
HAVE_PYTHON := 0
|
|
|
|
|
2015-07-14 12:00:28 -03:00
|
|
|
HAVE_STB_FONT := 1
|
2014-10-26 21:18:23 +01:00
|
|
|
HAVE_FREETYPE := 1
|
2014-10-26 21:17:11 +01:00
|
|
|
HAVE_FFMPEG := 0
|
|
|
|
|
2014-10-26 21:18:23 +01:00
|
|
|
HAVE_CG := 1
|
2014-10-26 21:17:11 +01:00
|
|
|
HAVE_LIBXML2 := 0
|
|
|
|
HAVE_ZLIB := 1
|
2015-03-14 05:24:57 +01:00
|
|
|
WANT_ZLIB := 1
|
2011-08-28 21:47:58 +02:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_CG), 1)
|
2014-09-16 17:45:45 -03:00
|
|
|
CG_LIBS := -lcg -lcgGL
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-16 17:45:45 -03:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_FREETYPE), 1)
|
2014-09-14 03:22:04 +02:00
|
|
|
FREETYPE_CFLAGS := -DHAVE_FREETYPE -Ifreetype2
|
|
|
|
FREETYPE_LIBS := -lfreetype
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-14 01:01:52 +02:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_LIBXML2), 1)
|
2014-09-14 03:22:04 +02:00
|
|
|
LIBXML2_CFLAGS := -Ilibxml2 -DHAVE_LIBXML2 -DHAVE_GLSL
|
|
|
|
LIBXML2_LIBS := -lxml2 -liconv
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-14 02:52:30 +02:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_SDL), 1)
|
2014-09-14 03:22:04 +02:00
|
|
|
SDL_LIBS := -lSDL
|
|
|
|
SDL_CFLAGS := -ISDL -DHAVE_SDL
|
|
|
|
BSD_LOCAL_INC :=
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-14 02:52:30 +02:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_SDL2), 1)
|
2014-09-14 03:22:04 +02:00
|
|
|
SDL2_LIBS := -lSDL2
|
|
|
|
SDL2_CFLAGS := -ISDL2 -DHAVE_SDL2
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-14 02:15:41 +02:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_RSOUND), 1)
|
2014-09-14 03:22:04 +02:00
|
|
|
RSOUND_CFLAGS := -DHAVE_RSOUND
|
|
|
|
RSOUND_LIBS := -lrsound
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-14 03:22:04 +02:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_PYTHON), 1)
|
2014-09-14 03:22:04 +02:00
|
|
|
PYTHON_LIBS := -lpython32
|
|
|
|
PYTHON_CFLAGS := -DHAVE_PYTHON -Ipython
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-14 03:22:04 +02:00
|
|
|
|
2014-10-26 21:17:11 +01:00
|
|
|
ifeq ($(HAVE_FFMPEG), 1)
|
2014-09-14 04:43:18 +02:00
|
|
|
AVCODEC_LIBS := -lavcodec
|
|
|
|
AVUTIL_LIBS := -lavutil
|
|
|
|
SWSCALE_LIBS := -lswscale
|
|
|
|
AVFORMAT_LIBS := -lavformat
|
2015-06-21 00:03:27 +02:00
|
|
|
SWRESAMPLE_LIBS := -lswresample
|
2014-09-14 04:43:18 +02:00
|
|
|
FFMPEG_LIBS := -lws2_32 -lz
|
2014-10-26 21:17:11 +01:00
|
|
|
endif
|
2014-09-14 04:43:18 +02:00
|
|
|
|
2014-09-14 03:22:04 +02:00
|
|
|
OBJDIR := obj-w32
|
2014-09-14 00:04:42 +02:00
|
|
|
|
2014-09-13 22:50:38 -03:00
|
|
|
OS := Win32
|
2014-09-14 00:55:17 +02:00
|
|
|
OBJ :=
|
|
|
|
LIBS := -lm
|
2015-02-19 00:04:03 +01:00
|
|
|
DEFINES := -I. -Ilibretro-common/include -DRARCH_INTERNAL -DHAVE_OVERLAY
|
2014-09-14 00:55:17 +02:00
|
|
|
LDFLAGS := -L. -static-libgcc
|
2014-09-14 00:04:42 +02:00
|
|
|
|
|
|
|
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 12:17:22 +02:00
|
|
|
libretro ?= -lretro
|
2011-01-07 17:59:53 +01:00
|
|
|
|
2011-01-19 13:25:18 +01:00
|
|
|
ifeq ($(DYNAMIC), 1)
|
|
|
|
DEFINES += -DHAVE_DYNAMIC
|
2011-01-19 16:11:45 +01:00
|
|
|
else
|
2012-04-22 12:17:22 +02:00
|
|
|
LIBS += $(libretro)
|
2011-01-19 13:25:18 +01: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
|
2012-11-04 22:55:11 +01:00
|
|
|
CXXFLAGS += -O0 -g
|
2012-06-17 00:18:23 +02:00
|
|
|
else
|
2013-02-14 11:56:35 +01:00
|
|
|
CFLAGS += -O3 -ffast-math
|
|
|
|
CXXFLAGS += -O3 -ffast-math
|
2012-06-17 00:18:23 +02:00
|
|
|
endif
|
|
|
|
|
2013-03-17 13:24:09 +01:00
|
|
|
CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I.
|
2015-09-06 15:12:17 +02:00
|
|
|
CXXFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -std=c++98 -D__STDC_CONSTANT_MACROS
|
2011-12-24 13:46:12 +01:00
|
|
|
ifeq ($(CXX_BUILD), 1)
|
2015-09-06 15:12:17 +02:00
|
|
|
CFLAGS += -std=c++98 -xc++ -D__STDC_CONSTANT_MACROS
|
2011-12-24 13:46:12 +01:00
|
|
|
else
|
2013-10-22 21:41:51 +02:00
|
|
|
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-02-02 15:29:07 +01:00
|
|
|
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
|
|
|
|
2016-03-04 04:24:47 +01:00
|
|
|
all: $(TARGET)
|
2011-01-07 17:59:53 +01:00
|
|
|
|
2016-03-04 04:24:47 +01:00
|
|
|
-include $(RARCH_OBJ:.o=.d)
|
2014-03-27 22:19:06 +01:00
|
|
|
|
2014-02-02 15:29:07 +01:00
|
|
|
$(TARGET): $(RARCH_OBJ)
|
2011-01-10 17:15:27 +01:00
|
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
2014-02-02 15:29:07 +01:00
|
|
|
$(Q)$(CXX) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
|
2011-01-09 16:08:06 +01:00
|
|
|
|
2015-08-26 17:57:49 +02:00
|
|
|
#those mkdir shenanigans are really ugly, but I can't find any better solution
|
2014-03-27 22:19:06 +01:00
|
|
|
$(OBJDIR)/%.o: %.c
|
2015-08-26 18:06:20 +02:00
|
|
|
@-mkdir -p $(dir $@) || mkdir $(subst /,\,$(dir $@)) || echo .
|
2014-01-11 18:51:42 +01:00
|
|
|
@$(if $(Q), $(shell echo echo CC $<),)
|
2014-03-27 22:19:06 +01:00
|
|
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
2014-01-11 18:51:42 +01:00
|
|
|
|
|
|
|
.FORCE:
|
|
|
|
|
2014-02-02 15:29:07 +01:00
|
|
|
$(OBJDIR)/git_version.o: git_version.c .FORCE
|
2015-08-26 18:06:20 +02:00
|
|
|
@-mkdir -p $(dir $@) || mkdir $(subst /,\,$(dir $@)) || echo .
|
2011-01-10 17:15:27 +01:00
|
|
|
@$(if $(Q), $(shell echo echo CC $<),)
|
2014-03-27 22:19:06 +01:00
|
|
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
2011-01-09 19:50:23 +01:00
|
|
|
|
2015-08-26 17:52:27 +02:00
|
|
|
$(OBJDIR)/%.o: %.cpp | $(dir $@)
|
2015-08-26 18:06:20 +02:00
|
|
|
@-mkdir -p $(dir $@) || mkdir $(subst /,\,$(dir $@)) || echo .
|
2012-10-26 21:09:30 +02:00
|
|
|
@$(if $(Q), $(shell echo echo CXX $<),)
|
2014-03-27 22:19:06 +01:00
|
|
|
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
2012-10-26 21:09:30 +02:00
|
|
|
|
2014-02-02 15:29:07 +01:00
|
|
|
$(OBJDIR)/%.o: %.rc $(HEADERS)
|
2015-08-26 18:06:20 +02:00
|
|
|
@-mkdir -p $(dir $@) || mkdir $(subst /,\,$(dir $@)) || echo .
|
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
|
|
|
|
2011-01-07 17:59:53 +01:00
|
|
|
clean:
|
2014-02-02 15:29:07 +01:00
|
|
|
rm -rf $(OBJDIR)
|
2011-01-07 17:59:53 +01:00
|
|
|
rm -f $(TARGET)
|
2014-11-18 16:01:36 +01:00
|
|
|
rm -f *.d
|
2011-08-28 21:56:56 +02:00
|
|
|
|
2016-03-04 04:24:47 +01:00
|
|
|
.PHONY: all install uninstall clean
|
2012-04-21 23:50:46 +02:00
|
|
|
|