2011-12-14 14:36:23 +01:00
|
|
|
###
|
|
|
|
##
|
2012-04-21 23:42:20 +02:00
|
|
|
# Makefile for RetroArch Wii.
|
2011-12-14 14:36:23 +01:00
|
|
|
##
|
|
|
|
|
2012-03-13 00:44:37 +01:00
|
|
|
DEBUG = 0
|
|
|
|
HAVE_LOGGER = 0
|
2012-04-13 22:54:30 +02:00
|
|
|
HAVE_FILE_LOGGER = 0
|
2012-03-13 00:44:37 +01:00
|
|
|
|
|
|
|
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
|
|
|
PC_DEVELOPMENT_UDP_PORT = 3490
|
2011-12-14 14:36:23 +01:00
|
|
|
|
2012-08-18 16:54:57 +02: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
|
|
|
|
|
|
|
|
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 14:36:23 +01:00
|
|
|
|
2012-09-01 03:01:33 +02:00
|
|
|
DOL_TARGET := retroarch_wii.dol
|
|
|
|
ELF_TARGET := retroarch_wii.elf
|
2011-12-14 14:36:23 +01:00
|
|
|
|
|
|
|
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include
|
2011-12-14 16:01:16 +01:00
|
|
|
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/wii -L.
|
2011-12-14 14:36:23 +01:00
|
|
|
|
2012-04-13 02:17:27 +02:00
|
|
|
MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
|
2012-06-26 18:58:41 +02:00
|
|
|
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
|
2012-08-27 20:36:05 -04: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
|
2012-06-30 14:59:39 +02:00
|
|
|
LIBS := -lfat -lretro_wii -lwiiuse -logc -lbte
|
2011-12-14 14:36:23 +01:00
|
|
|
|
2012-08-30 18:59:21 -04:00
|
|
|
APP_BOOTER_DIR = gx/app_booter
|
|
|
|
|
2012-08-31 19:38:12 -04:00
|
|
|
OBJ = console/griffin/griffin.o console/font.binobj console/rzlib/rzlib.o $(APP_BOOTER_DIR)/app_booter_wii.binobj
|
2011-12-14 14:36:23 +01:00
|
|
|
|
2012-03-13 00:44:37 +01:00
|
|
|
ifeq ($(HAVE_LOGGER), 1)
|
|
|
|
CFLAGS += -DHAVE_LOGGER
|
2012-06-26 18:58:41 +02:00
|
|
|
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
2012-07-28 17:32:30 +02:00
|
|
|
CFLAGS += -Iconsole/logger
|
|
|
|
OBJ += console/logger/logger.o
|
2012-03-13 00:44:37 +01:00
|
|
|
endif
|
|
|
|
|
2012-04-13 22:54:30 +02:00
|
|
|
ifeq ($(HAVE_FILE_LOGGER), 1)
|
|
|
|
CFLAGS += -DHAVE_FILE_LOGGER
|
2012-07-28 17:32:30 +02:00
|
|
|
CFLAGS += -Iconsole/logger
|
2012-04-13 22:54:30 +02:00
|
|
|
endif
|
|
|
|
|
2012-08-29 15:15:24 -04:00
|
|
|
CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DHAVE_CONFIGFILE=1 -DGEKKO -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"0.9.7\" -Dmain=rarch_main -Wno-char-subscripts
|
2011-12-14 14:36:23 +01:00
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS += -O0 -g
|
|
|
|
else
|
2012-07-28 17:57:36 +02:00
|
|
|
CFLAGS += -O3
|
2011-12-14 14:36:23 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(DOL_TARGET)
|
|
|
|
|
|
|
|
%.dol: %.elf
|
2012-08-18 16:54:57 +02:00
|
|
|
$(ELF2DOL) $< $@
|
2011-12-14 14:36:23 +01:00
|
|
|
|
|
|
|
$(ELF_TARGET): $(OBJ)
|
2011-12-14 19:11:46 +01:00
|
|
|
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
2011-12-14 14:36:23 +01:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
2012-01-08 00:57:44 +01:00
|
|
|
%.bmpobj: %.bmp
|
|
|
|
$(LD) -r -b binary -o $@ $<
|
|
|
|
|
2012-08-26 20:33:22 -04:00
|
|
|
%.binobj: %.bin
|
|
|
|
$(LD) -r -b binary -o $@ $<
|
|
|
|
|
2012-08-31 19:38:12 -04:00
|
|
|
$(APP_BOOTER_DIR)/app_booter_wii.bin:
|
|
|
|
$(MAKE) -C $(APP_BOOTER_DIR) platform=wii
|
2012-08-30 18:59:21 -04:00
|
|
|
|
2012-06-26 18:58:41 +02:00
|
|
|
pkg: all
|
2012-09-01 03:01:33 +02:00
|
|
|
cp -r $(DOL_TARGET) wii/pkg/CORE.dol
|
2012-06-26 18:58:41 +02:00
|
|
|
|
2011-12-14 14:36:23 +01:00
|
|
|
clean:
|
|
|
|
rm -f $(DOL_TARGET)
|
|
|
|
rm -f $(ELF_TARGET)
|
|
|
|
rm -f $(OBJ)
|
2012-08-31 19:38:12 -04:00
|
|
|
$(MAKE) -C $(APP_BOOTER_DIR) platform=wii clean
|
2011-12-14 14:36:23 +01:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|