RetroArch/Makefile.wiiu

213 lines
5.3 KiB
Makefile
Raw Normal View History

2016-10-27 00:34:10 +00:00
TARGET := retroarch_wiiu
BUILD_HBL_ELF = 1
BUILD_RPX = 1
2016-10-27 00:34:10 +00:00
DEBUG = 0
GRIFFIN_BUILD = 0
WHOLE_ARCHIVE_LINK = 0
PC_DEVELOPMENT_IP_ADDRESS =
PC_DEVELOPMENT_TCP_PORT =
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
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
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)
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)
CFLAGS += -O0 -g
2016-10-27 00:34:10 +00:00
else
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
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
CFLAGS += -Dstatic_assert=_Static_assert
CFLAGS += -DWIIU -DMSB_FIRST
2016-10-27 00:34:10 +00:00
CFLAGS += -DHAVE_MAIN
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
2016-10-27 00:34:10 +00:00
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
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
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
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
LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm
2016-10-27 00:34:10 +00:00
RPX_OBJ = wiiu/system/stubs_rpl.o
HBL_ELF_OBJ = wiiu/system/dynamic.o wiiu/system/stubs_elf.o
RPX_LDFLAGS := -L$(WUT_ROOT)/lib -L$(DEVKITPPC)/lib
RPX_LDFLAGS += -pie -fPIE
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
endif
2016-10-27 00:34:10 +00:00
ifeq ($(BUILD_HBL_ELF), 1)
TARGETS += $(TARGET).elf
endif
DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend
POSTCOMPILE = mv -f $*.Tdepend $*.depend
all: $(TARGETS)
2016-10-27 00:34:10 +00:00
%.o: %.cpp
%.o: %.cpp %.depend
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
2016-10-27 00:34:10 +00:00
%.o: %.c
%.o: %.c %.depend
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
2016-10-27 00:34:10 +00:00
%.o: %.S
%.o: %.S %.depend
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
2016-10-27 00:34:10 +00:00
%.o: %.s
%.o: %.s %.depend
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
2016-10-27 00:34:10 +00:00
%.a:
$(AR) -rc $@ $^
%.depend: ;
$(TARGET).elf: $(OBJ) $(HBL_ELF_OBJ) libretro_wiiu.a wiiu/link_elf.ld
$(LD) $(OBJ) $(HBL_ELF_OBJ) $(LDFLAGS) $(HBL_ELF_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
$(TARGET).rpx.elf: $(OBJ) $(RPX_OBJ) libretro_wiiu.a wiiu/link_elf.ld
$(LD) $(OBJ) $(RPX_OBJ) $(LDFLAGS) $(RPX_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
$(TARGET).rpx: $(TARGET).rpx.elf
2016-11-23 04:27:52 +00:00
-$(ELF2RPL) $(notdir $<) $@
2016-10-27 00:34:10 +00:00
clean:
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
.PHONY: clean all
.PRECIOUS: %.depend
-include $(OBJ:.o=.depend) $(RPX_OBJ:.o=.depend) $(HBL_ELF_OBJ:.o=.depend)