RetroArch/Makefile.wiiu

163 lines
4.1 KiB
Makefile
Raw Normal View History

2016-10-27 00:34:10 +00:00
TARGET := retroarch_wiiu
DEBUG = 0
GRIFFIN_BUILD = 0
WHOLE_ARCHIVE_LINK = 0
OBJ :=
OBJ += wiiu/system/memory.o
2016-10-27 18:53:27 +00:00
OBJ += wiiu/system/exception_handler.o
OBJ += wiiu/fs/sd_fat_devoptab.o
2016-10-27 00:34:10 +00:00
OBJ += wiiu/fs/fs_utils.o
OBJ += wiiu/system/dynamic.o
OBJ += wiiu/system/dyn_stubs.o
2016-11-05 14:05:46 +00:00
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
# OBJ += audio/drivers/wiiu_audio.o
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)
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
else
CFLAGS += -O3
endif
2016-10-27 18:53:27 +00:00
LDFLAGS := $(CFLAGS)
2016-10-27 00:34:10 +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
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 -DSINC_LOWEST_QUALITY
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
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
LDFLAGS += -nostartfiles -Wl,-Map,$(notdir $@).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc
LDFLAGS += -Wl,-wrap,malloc_usable_size,-wrap,_malloc_r,-wrap,_free_r,-wrap,_realloc_r,-wrap,_calloc_r,-wrap,_memalign_r
LDFLAGS += -Wl,-wrap,_malloc_usable_size_r,-wrap,valloc,-wrap,_valloc_r,-wrap,_pvalloc_r,--gc-sections
LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm
all: $(TARGET)
$(TARGET): $(TARGET).elf
%.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-02 21:06:15 +00:00
$(TARGET).elf: $(OBJ) libretro_wiiu.a wiiu/link_ra.ld
$(LD) -n -T wiiu/link_ra.ld $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
2016-10-27 00:34:10 +00:00
clean:
rm -f $(OBJ)
rm -f $(TARGET).elf
.PHONY: $(BUILD) clean all