RetroArch/Makefile.wii

106 lines
2.6 KiB
Makefile
Raw Normal View History

2011-12-14 13:36:23 +00:00
###
##
2012-04-21 21:42:20 +00:00
# Makefile for RetroArch Wii.
2011-12-14 13:36:23 +00:00
##
2012-03-12 23:44:37 +00:00
DEBUG = 0
HAVE_LOGGER = 0
HAVE_FILE_LOGGER = 0
PERF_TEST = 0
2013-01-25 23:44:54 +00:00
HAVE_WIIUSE_MOD = 0
2012-03-12 23:44:37 +00:00
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.100"
2012-03-12 23:44:37 +00:00
PC_DEVELOPMENT_UDP_PORT = 3490
2011-12-14 13:36:23 +00:00
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
ifeq ($(HAVE_WIIUSE_MOD), 1)
CFLAGS += -DHAVE_WIIUSE
else
LDFLAGS_WIIUSE := -lwiiuse
endif
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
2011-12-14 13:36:23 +00:00
DOL_TARGET := retroarch_wii.dol
ELF_TARGET := retroarch_wii.elf
2011-12-14 13:36:23 +00:00
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/ogc
2011-12-14 15:01:16 +00:00
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/wii -L.
2011-12-14 13:36:23 +00:00
MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
2012-06-26 16:58:41 +00:00
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
2012-08-28 00:36:05 +00:00
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size -T gx/ld/rvl.ld
LIBS := -lfat -lretro_wii -logc $(LDFLAGS_WIIUSE) -lbte
APP_BOOTER_DIR = wii/app_booter
OBJ = console/griffin/griffin.o $(APP_BOOTER_DIR)/app_booter.binobj
2011-12-14 13:36:23 +00:00
ifeq ($(PERF_TEST), 1)
CFLAGS += -DPERF_TEST
endif
2012-03-12 23:44:37 +00:00
ifeq ($(HAVE_LOGGER), 1)
CFLAGS += -DHAVE_LOGGER
2012-06-26 16:58:41 +00:00
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
CFLAGS += -Iconsole/logger
2012-03-12 23:44:37 +00:00
endif
ifeq ($(HAVE_FILE_LOGGER), 1)
CFLAGS += -DHAVE_FILE_LOGGER
CFLAGS += -Iconsole/logger
endif
2013-01-21 23:22:09 +00:00
CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DHAVE_RMENU -DGEKKO -DHAVE_ZLIB -DWANT_RZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"0.9.8\" -Dmain=rarch_main -Wno-char-subscripts
2011-12-14 13:36:23 +00:00
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g -DDEBUG
2011-12-14 13:36:23 +00:00
else
CFLAGS += -O3
2011-12-14 13:36:23 +00:00
endif
all: $(DOL_TARGET)
%.dol: %.elf
$(ELF2DOL) $< $@
2011-12-14 13:36:23 +00:00
$(ELF_TARGET): $(OBJ)
2011-12-14 18:11:46 +00:00
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
2011-12-14 13:36:23 +00:00
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
2012-01-07 23:57:44 +00:00
%.bmpobj: %.bmp
$(LD) -r -b binary -o $@ $<
%.binobj: %.bin
$(LD) -r -b binary -o $@ $<
$(APP_BOOTER_DIR)/app_booter.bin:
$(MAKE) -C $(APP_BOOTER_DIR)
2012-06-26 16:58:41 +00:00
pkg: all
cp -r $(DOL_TARGET) wii/pkg/CORE.dol
2012-06-26 16:58:41 +00:00
2011-12-14 13:36:23 +00:00
clean:
rm -f $(DOL_TARGET)
rm -f $(ELF_TARGET)
rm -f $(OBJ)
$(MAKE) -C $(APP_BOOTER_DIR) clean
2011-12-14 13:36:23 +00:00
.PHONY: clean