2016-10-27 00:34:10 +00:00
|
|
|
TARGET := retroarch_wiiu
|
2016-11-23 02:21:01 +00:00
|
|
|
BUILD_HBL_ELF = 1
|
2017-05-20 17:25:33 +00:00
|
|
|
BUILD_RPX = 1
|
2016-10-27 00:34:10 +00:00
|
|
|
DEBUG = 0
|
|
|
|
GRIFFIN_BUILD = 0
|
|
|
|
WHOLE_ARCHIVE_LINK = 0
|
|
|
|
|
2017-11-04 05:19:49 +00:00
|
|
|
ifneq ($(V), 1)
|
|
|
|
Q := @
|
|
|
|
endif
|
|
|
|
|
2017-05-28 11:42:19 +00:00
|
|
|
PC_DEVELOPMENT_IP_ADDRESS ?=
|
|
|
|
PC_DEVELOPMENT_TCP_PORT ?=
|
2016-11-08 08:25:20 +00:00
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
OBJ :=
|
|
|
|
OBJ += wiiu/system/memory.o
|
|
|
|
OBJ += wiiu/system/exception_handler.o
|
2017-06-15 05:21:38 +00:00
|
|
|
OBJ += wiiu/system/missing_libc_functions.o
|
2016-11-09 13:26:38 +00:00
|
|
|
OBJ += wiiu/fs/sd_fat_devoptab.o
|
|
|
|
OBJ += wiiu/fs/fs_utils.o
|
|
|
|
OBJ += wiiu/tex_shader.o
|
2017-01-25 18:52:31 +00:00
|
|
|
OBJ += wiiu/hbl.o
|
2016-11-09 13:26:38 +00:00
|
|
|
|
2017-12-01 07:29:21 +00:00
|
|
|
ifeq ($(ENABLE_CONTROLLER_PATCHER), 1)
|
|
|
|
OBJ += wiiu/controller_patcher/ControllerPatcher.o
|
|
|
|
OBJ += wiiu/controller_patcher/ControllerPatcherWrapper.o
|
|
|
|
OBJ += wiiu/controller_patcher/ConfigReader.o
|
|
|
|
OBJ += wiiu/controller_patcher/config/ConfigParser.o
|
|
|
|
OBJ += wiiu/controller_patcher/config/ConfigValues.o
|
|
|
|
OBJ += wiiu/controller_patcher/network/ControllerPatcherNet.o
|
|
|
|
OBJ += wiiu/controller_patcher/network/TCPServer.o
|
|
|
|
OBJ += wiiu/controller_patcher/network/UDPClient.o
|
|
|
|
OBJ += wiiu/controller_patcher/network/UDPServer.o
|
|
|
|
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherUtils.o
|
|
|
|
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherHID.o
|
|
|
|
OBJ += wiiu/controller_patcher/utils/CPRetainVars.o
|
|
|
|
OBJ += wiiu/controller_patcher/utils/CPStringTools.o
|
|
|
|
OBJ += wiiu/controller_patcher/utils/PadConst.o
|
|
|
|
OBJ += wiiu/controller_patcher/utils/FSHelper.o
|
|
|
|
endif
|
|
|
|
|
2016-10-27 00:34:10 +00:00
|
|
|
DEFINES :=
|
|
|
|
|
|
|
|
ifeq ($(GRIFFIN_BUILD), 1)
|
|
|
|
OBJ += griffin/griffin.o
|
|
|
|
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_LIBRETRODB
|
2016-12-12 11:44:29 +00:00
|
|
|
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_CC_RESAMPLER
|
2017-09-27 23:03:34 +00:00
|
|
|
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING
|
2017-05-23 09:24:23 +00:00
|
|
|
# DEFINES += -DWANT_IFADDRS
|
2017-05-21 03:22:32 +00:00
|
|
|
# DEFINES += -DHAVE_FREETYPE
|
2017-05-22 00:45:40 +00:00
|
|
|
DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
|
2016-10-27 00:34:10 +00:00
|
|
|
else
|
|
|
|
HAVE_MENU_COMMON = 1
|
|
|
|
HAVE_RTGA = 1
|
|
|
|
HAVE_RPNG = 1
|
|
|
|
HAVE_RJPEG = 1
|
|
|
|
HAVE_RBMP = 1
|
|
|
|
HAVE_RGUI = 1
|
|
|
|
HAVE_ZLIB = 1
|
|
|
|
HAVE_7ZIP = 1
|
|
|
|
HAVE_BUILTINZLIB = 1
|
2017-09-28 02:20:39 +00:00
|
|
|
HAVE_KEYMAPPER = 1
|
2016-10-27 00:34:10 +00:00
|
|
|
HAVE_LIBRETRODB = 1
|
|
|
|
HAVE_ZARCH = 0
|
2017-05-22 00:45:40 +00:00
|
|
|
HAVE_MATERIALUI = 1
|
|
|
|
HAVE_XMB = 1
|
2017-05-21 03:22:32 +00:00
|
|
|
HAVE_STB_FONT = 1
|
|
|
|
# HAVE_FREETYPE = 1
|
2017-05-21 03:36:55 +00:00
|
|
|
HAVE_LANGEXTRA = 1
|
2017-05-22 05:07:27 +00:00
|
|
|
HAVE_LIBRETRODB = 1
|
2017-05-23 09:24:23 +00:00
|
|
|
HAVE_NETWORKING = 1
|
2017-10-04 00:35:15 +00:00
|
|
|
HAVE_CHEEVOS = 1
|
2017-05-23 09:24:23 +00:00
|
|
|
# WANT_IFADDRS = 1
|
2017-12-27 07:38:03 +00:00
|
|
|
HAVE_OVERLAY = 1
|
2017-12-07 04:54:54 +00:00
|
|
|
HAVE_STATIC_VIDEO_FILTERS = 1
|
|
|
|
HAVE_STATIC_AUDIO_FILTERS = 1
|
2017-12-19 21:12:58 +00:00
|
|
|
WANT_LIBFAT = 1
|
|
|
|
WANT_IOSUHAX = 1
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
include Makefile.common
|
2017-12-27 07:38:03 +00:00
|
|
|
BLACKLIST := $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o
|
2016-10-27 00:34:10 +00:00
|
|
|
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
|
|
|
|
|
|
|
OBJ += gfx/drivers/wiiu_gfx.o
|
2017-05-21 02:05:41 +00:00
|
|
|
OBJ += gfx/drivers_font/wiiu_font.o
|
2017-05-22 00:45:40 +00:00
|
|
|
OBJ += menu/drivers_display/menu_display_wiiu.o
|
2016-10-27 00:34:10 +00:00
|
|
|
OBJ += input/drivers/wiiu_input.o
|
|
|
|
OBJ += input/drivers_joypad/wiiu_joypad.o
|
2016-11-06 18:03:41 +00:00
|
|
|
OBJ += audio/drivers/wiiu_audio.o
|
2016-10-27 00:34:10 +00:00
|
|
|
OBJ += frontend/drivers/platform_wiiu.o
|
|
|
|
endif
|
|
|
|
|
2017-09-27 23:03:34 +00:00
|
|
|
DEFINES += -DHAVE_KEYMAPPER
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
ifeq ($(strip $(DEVKITPPC)),)
|
|
|
|
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(DEVKITPRO)),)
|
|
|
|
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
|
|
|
|
endif
|
2016-10-29 01:56:40 +00:00
|
|
|
|
2016-11-02 21:06:15 +00:00
|
|
|
export PATH := $(PATH):$(DEVKITPPC)/bin
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
PREFIX := powerpc-eabi-
|
|
|
|
|
|
|
|
CC := $(PREFIX)gcc
|
|
|
|
CXX := $(PREFIX)g++
|
|
|
|
AS := $(PREFIX)as
|
|
|
|
AR := $(PREFIX)ar
|
|
|
|
OBJCOPY := $(PREFIX)objcopy
|
|
|
|
STRIP := $(PREFIX)strip
|
|
|
|
NM := $(PREFIX)nm
|
|
|
|
LD := $(CXX)
|
|
|
|
|
2017-01-18 10:38:01 +00:00
|
|
|
ELF2RPL := wiiu/wut/elf2rpl/elf2rpl
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2017-01-23 14:59:44 +00:00
|
|
|
ifneq ($(findstring Linux,$(shell uname -a)),)
|
|
|
|
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
|
|
|
else
|
|
|
|
ELF2RPL := $(ELF2RPL).exe
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2017-11-06 04:23:53 +00:00
|
|
|
INCDIRS := -I. -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include
|
2016-12-17 17:42:04 +00:00
|
|
|
LIBDIRS := -L. -L$(DEVKITPRO)/portlibs/ppc/lib
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2017-01-23 14:59:44 +00:00
|
|
|
CFLAGS := -mwup -mcpu=750 -meabi -mhard-float
|
2016-10-27 00:34:10 +00:00
|
|
|
LDFLAGS :=
|
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
2016-11-08 08:25:20 +00:00
|
|
|
CFLAGS += -O0 -g
|
2016-10-27 00:34:10 +00:00
|
|
|
else
|
2016-11-08 08:25:20 +00:00
|
|
|
CFLAGS += -O3
|
2016-10-27 00:34:10 +00:00
|
|
|
endif
|
2016-10-27 18:53:27 +00:00
|
|
|
LDFLAGS := $(CFLAGS)
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-24 02:26:34 +00:00
|
|
|
ASFLAGS := $(CFLAGS) -mregnames
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
|
|
|
#CFLAGS += -fomit-frame-pointer -mword-relocations
|
|
|
|
#CFLAGS += -Wall
|
2017-01-23 14:59:44 +00:00
|
|
|
|
|
|
|
#todo: remove -DWIIU and use the built-in macros instead (HW_WUP or __wiiu__).
|
2017-12-20 02:47:30 +00:00
|
|
|
CFLAGS += -DWIIU -DMSB_FIRST -D__WUT__
|
2016-10-27 00:34:10 +00:00
|
|
|
CFLAGS += -DHAVE_MAIN
|
2017-05-23 09:24:23 +00:00
|
|
|
CFLAGS += -DHAVE_UPDATE_ASSETS
|
2016-11-24 03:45:22 +00:00
|
|
|
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
2017-12-01 07:29:21 +00:00
|
|
|
ifeq ($(ENABLE_CONTROLLER_PATCHER), 1)
|
|
|
|
CFLAGS += -DENABLE_CONTROLLER_PATCHER
|
|
|
|
endif
|
2016-10-27 00:34:10 +00:00
|
|
|
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
|
|
|
|
2016-11-08 08:25:20 +00:00
|
|
|
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
|
|
|
|
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"'
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(PC_DEVELOPMENT_TCP_PORT),)
|
|
|
|
CFLAGS += -DPC_DEVELOPMENT_TCP_PORT=$(PC_DEVELOPMENT_TCP_PORT)
|
|
|
|
endif
|
|
|
|
|
2016-10-27 00:34:10 +00:00
|
|
|
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
|
|
|
WHOLE_START := -Wl,--whole-archive
|
|
|
|
WHOLE_END := -Wl,--no-whole-archive
|
|
|
|
endif
|
2017-05-08 10:24:06 +00:00
|
|
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -D_GNU_SOURCE
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-16 17:25:23 +00:00
|
|
|
LDFLAGS += -Wl,--gc-sections
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2017-12-19 21:12:58 +00:00
|
|
|
LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm
|
|
|
|
|
|
|
|
ifneq ($(WANT_LIBFAT), 1)
|
|
|
|
LIBS += -lfat
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(WANT_IOSUHAX), 1)
|
|
|
|
LIBS += -liosuhax
|
|
|
|
endif
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-23 02:21:01 +00:00
|
|
|
|
|
|
|
RPX_OBJ = wiiu/system/stubs_rpl.o
|
|
|
|
HBL_ELF_OBJ = wiiu/system/dynamic.o wiiu/system/stubs_elf.o
|
|
|
|
|
2017-01-18 10:38:01 +00:00
|
|
|
RPX_LDFLAGS := -pie -fPIE
|
2016-11-23 02:21:01 +00:00
|
|
|
RPX_LDFLAGS += -z common-page-size=64 -z max-page-size=64
|
|
|
|
RPX_LDFLAGS += -T wiiu/link_rpl.ld
|
|
|
|
RPX_LDFLAGS += -nostartfiles
|
|
|
|
|
|
|
|
HBL_ELF_LDFLAGS := -T wiiu/link_elf.ld
|
|
|
|
|
|
|
|
TARGETS :=
|
|
|
|
ifeq ($(BUILD_RPX), 1)
|
|
|
|
TARGETS += $(TARGET).rpx
|
2016-11-09 13:26:38 +00:00
|
|
|
endif
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-23 02:21:01 +00:00
|
|
|
ifeq ($(BUILD_HBL_ELF), 1)
|
|
|
|
TARGETS += $(TARGET).elf
|
|
|
|
endif
|
|
|
|
|
2016-11-24 02:26:34 +00:00
|
|
|
DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend
|
|
|
|
POSTCOMPILE = mv -f $*.Tdepend $*.depend
|
|
|
|
|
|
|
|
|
2016-11-23 02:21:01 +00:00
|
|
|
all: $(TARGETS)
|
|
|
|
|
2016-10-27 00:34:10 +00:00
|
|
|
%.o: %.cpp
|
2016-11-24 02:26:34 +00:00
|
|
|
%.o: %.cpp %.depend
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo CXX $<,)
|
|
|
|
$(Q)$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(Q)$(POSTCOMPILE)
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
2016-11-24 02:26:34 +00:00
|
|
|
%.o: %.c %.depend
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo CC $<,)
|
|
|
|
$(Q)$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(Q)$(POSTCOMPILE)
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
%.o: %.S
|
2016-11-24 02:26:34 +00:00
|
|
|
%.o: %.S %.depend
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo AS $<,)
|
|
|
|
$(Q)$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(Q)$(POSTCOMPILE)
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-24 02:26:34 +00:00
|
|
|
%.o: %.s
|
|
|
|
%.o: %.s %.depend
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo AS $<,)
|
|
|
|
$(Q)$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(Q)$(POSTCOMPILE)
|
2016-10-27 00:34:10 +00:00
|
|
|
%.a:
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo AR $<,)
|
|
|
|
$(Q)$(AR) -rc $@ $^
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-24 02:26:34 +00:00
|
|
|
%.depend: ;
|
|
|
|
|
|
|
|
|
2017-01-18 10:38:01 +00:00
|
|
|
$(ELF2RPL):
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo MAKE $@,)
|
|
|
|
$(Q)$(MAKE) -C wiiu/wut/elf2rpl/
|
2017-01-18 10:38:01 +00:00
|
|
|
|
2016-11-23 02:21:01 +00:00
|
|
|
$(TARGET).elf: $(OBJ) $(HBL_ELF_OBJ) libretro_wiiu.a wiiu/link_elf.ld
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo LD $@,)
|
|
|
|
$(Q)$(LD) $(OBJ) $(HBL_ELF_OBJ) $(LDFLAGS) $(HBL_ELF_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
2016-11-23 02:21:01 +00:00
|
|
|
|
|
|
|
$(TARGET).rpx.elf: $(OBJ) $(RPX_OBJ) libretro_wiiu.a wiiu/link_elf.ld
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo LD $@,)
|
|
|
|
$(Q)$(LD) $(OBJ) $(RPX_OBJ) $(LDFLAGS) $(RPX_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
2016-11-09 13:26:38 +00:00
|
|
|
|
2017-01-18 10:38:01 +00:00
|
|
|
$(TARGET).rpx: $(TARGET).rpx.elf $(ELF2RPL)
|
2017-11-04 05:19:49 +00:00
|
|
|
@$(if $(Q), echo ELF2RPL $@,)
|
|
|
|
$(Q)-$(ELF2RPL) $(TARGET).rpx.elf $@
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
clean:
|
2016-11-24 02:26:34 +00:00
|
|
|
rm -f $(OBJ) $(RPX_OBJ) $(HBL_ELF_OBJ) $(TARGET).elf $(TARGET).rpx.elf $(TARGET).rpx
|
|
|
|
rm -f $(OBJ:.o=.depend) $(RPX_OBJ:.o=.depend) $(HBL_ELF_OBJ:.o=.depend)
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
.PHONY: clean all
|
2016-11-24 02:26:34 +00:00
|
|
|
.PRECIOUS: %.depend
|
|
|
|
|
|
|
|
-include $(OBJ:.o=.depend) $(RPX_OBJ:.o=.depend) $(HBL_ELF_OBJ:.o=.depend)
|