2016-10-27 00:34:10 +00:00
|
|
|
TARGET := retroarch_wiiu
|
2016-11-09 13:26:38 +00:00
|
|
|
RPX_BUILD = 0
|
2016-10-27 00:34:10 +00:00
|
|
|
DEBUG = 0
|
|
|
|
GRIFFIN_BUILD = 0
|
|
|
|
WHOLE_ARCHIVE_LINK = 0
|
|
|
|
|
2016-11-08 08:25:20 +00:00
|
|
|
PC_DEVELOPMENT_IP_ADDRESS =
|
|
|
|
PC_DEVELOPMENT_TCP_PORT =
|
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
OBJ :=
|
|
|
|
OBJ += wiiu/system/memory.o
|
|
|
|
OBJ += wiiu/system/exception_handler.o
|
|
|
|
OBJ += wiiu/fs/sd_fat_devoptab.o
|
|
|
|
OBJ += wiiu/fs/fs_utils.o
|
|
|
|
OBJ += wiiu/tex_shader.o
|
|
|
|
|
|
|
|
ifneq ($(RPX_BUILD), 1)
|
|
|
|
OBJ += wiiu/system/dynamic.o
|
|
|
|
OBJ += wiiu/system/dyn_stubs.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
|
|
|
|
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB
|
|
|
|
# DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
|
|
|
|
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
|
|
|
|
HAVE_LIBRETRODB = 1
|
|
|
|
HAVE_ZARCH = 0
|
|
|
|
HAVE_MATERIALUI = 0
|
|
|
|
HAVE_XMB = 0
|
|
|
|
|
|
|
|
include Makefile.common
|
|
|
|
BLACKLIST :=
|
|
|
|
BLACKLIST += input/input_overlay.o
|
|
|
|
BLACKLIST += tasks/task_overlay.o
|
|
|
|
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
|
|
|
|
|
|
|
OBJ += gfx/drivers/wiiu_gfx.o
|
|
|
|
# OBJ += gfx/drivers_font/wiiu_font.o
|
|
|
|
# OBJ += menu/drivers_display/menu_display_wiiu.o
|
|
|
|
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
|
|
|
|
OBJ += gfx/video_filters/2xsai.o
|
|
|
|
OBJ += gfx/video_filters/super2xsai.o
|
|
|
|
OBJ += gfx/video_filters/supereagle.o
|
|
|
|
OBJ += gfx/video_filters/2xbr.o
|
|
|
|
OBJ += gfx/video_filters/darken.o
|
|
|
|
OBJ += gfx/video_filters/epx.o
|
|
|
|
OBJ += gfx/video_filters/scale2x.o
|
|
|
|
OBJ += gfx/video_filters/blargg_ntsc_snes.o
|
|
|
|
OBJ += gfx/video_filters/lq2x.o
|
|
|
|
OBJ += gfx/video_filters/phosphor2x.o
|
|
|
|
OBJ += audio/audio_filters/echo.o
|
|
|
|
OBJ += audio/audio_filters/eq.o
|
|
|
|
OBJ += audio/audio_filters/chorus.o
|
|
|
|
OBJ += audio/audio_filters/iir.o
|
|
|
|
OBJ += audio/audio_filters/panning.o
|
|
|
|
OBJ += audio/audio_filters/phaser.o
|
|
|
|
OBJ += audio/audio_filters/reverb.o
|
|
|
|
OBJ += audio/audio_filters/wahwah.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
ifeq ($(strip $(WUT_ROOT)),)
|
|
|
|
$(error "Please set WUT_ROOT in your environment. export WUT_ROOT=<path to>WUT")
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
ELF2RPL := $(WUT_ROOT)/tools/bin/elf2rpl
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-02 21:06:15 +00:00
|
|
|
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -I$(WUT_ROOT)/include
|
2016-10-27 00:34:10 +00:00
|
|
|
LIBDIRS := -L.
|
|
|
|
|
|
|
|
CFLAGS := -mrvl -mcpu=750 -meabi -mhard-float
|
|
|
|
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-10-29 01:56:40 +00:00
|
|
|
ASFLAGS := $(CFLAGS) -mregnames $(INCDIRS)
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
|
|
|
#CFLAGS += -fomit-frame-pointer -mword-relocations
|
|
|
|
#CFLAGS += -Wall
|
2016-10-29 01:56:40 +00:00
|
|
|
CFLAGS += -Dstatic_assert=_Static_assert
|
2016-10-27 14:33:40 +00:00
|
|
|
CFLAGS += -DWIIU -DMSB_FIRST
|
2016-10-27 00:34:10 +00:00
|
|
|
CFLAGS += -DHAVE_MAIN
|
|
|
|
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE -DSINC_LOWEST_QUALITY
|
|
|
|
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
|
2016-10-29 01:56:40 +00:00
|
|
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
ifeq ($(RPX_BUILD), 1)
|
|
|
|
CFLAGS += -fno-builtin -ffreestanding -DRPX_BUILD
|
|
|
|
LIBDIRS += -L$(WUT_ROOT)/lib -L$(DEVKITPPC)/lib
|
2016-11-16 16:44:54 +00:00
|
|
|
LDFLAGS += -pie -fPIE
|
|
|
|
LDFLAGS += -z common-page-size=64 -z max-page-size=64
|
|
|
|
LDFLAGS += -lcoreinit -lgx2 -lnsysnet -lproc_ui -lsndcore2 -lsysapp -lvpad
|
2016-11-15 18:37:30 +00:00
|
|
|
LDFLAGS += -T $(WUT_ROOT)/rules/rpl.ld
|
|
|
|
# LDFLAGS += -T wiiu/link_rpl.ld
|
2016-11-16 16:44:54 +00:00
|
|
|
LDFLAGS += -nostartfiles
|
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
else
|
2016-11-15 18:37:30 +00:00
|
|
|
LDFLAGS += -T wiiu/link_elf.ld
|
2016-11-09 13:26:38 +00:00
|
|
|
endif
|
|
|
|
|
2016-11-16 17:25:23 +00:00
|
|
|
LDFLAGS += -Wl,--gc-sections
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
ifeq ($(RPX_BUILD), 1)
|
|
|
|
all: $(TARGET).elf $(TARGET).rpx
|
|
|
|
else
|
|
|
|
all: $(TARGET).elf
|
|
|
|
endif
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS)
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
$(CC) -c -o $@ $< $(ASFLAGS)
|
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
$(CC) -c -o $@ $< $(ASFLAGS)
|
|
|
|
|
|
|
|
%.a:
|
|
|
|
$(AR) -rc $@ $^
|
|
|
|
|
2016-11-16 16:44:54 +00:00
|
|
|
$(TARGET).elf: $(OBJ) libretro_wiiu.a wiiu/link_elf.ld wiiu/link_rpl.ld
|
2016-11-09 13:26:38 +00:00
|
|
|
$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
%.rpx: %.elf
|
2016-11-15 18:37:30 +00:00
|
|
|
$(ELF2RPL) $(notdir $<) $@
|
2016-10-27 00:34:10 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJ)
|
|
|
|
rm -f $(TARGET).elf
|
2016-11-09 13:26:38 +00:00
|
|
|
rm -f $(TARGET).rpx
|
2016-10-27 00:34:10 +00:00
|
|
|
|
2016-11-09 13:26:38 +00:00
|
|
|
.PHONY: clean all
|