2013-05-26 23:28:32 +00:00
|
|
|
RARCH_VERSION = "0.9.9"
|
2012-08-29 19:15:24 +00:00
|
|
|
|
|
|
|
DEBUG = 0
|
2012-09-01 03:22:56 +00:00
|
|
|
HAVE_LOGGER = 1
|
2012-08-29 19:15:24 +00:00
|
|
|
HAVE_FILE_LOGGER = 0
|
2012-10-01 22:47:20 +00:00
|
|
|
PERF_TEST = 0
|
2013-02-22 20:24:05 +00:00
|
|
|
WHOLE_ARCHIVE_LINK = 0
|
|
|
|
BIG_STACK = 0
|
2012-08-29 19:15:24 +00:00
|
|
|
|
|
|
|
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
|
|
|
PC_DEVELOPMENT_UDP_PORT = 3490
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
2012-09-01 01:01:33 +00:00
|
|
|
DOL_TARGET := retroarch_ngc.dol
|
|
|
|
ELF_TARGET := retroarch_ngc.elf
|
2012-08-29 19:15:24 +00:00
|
|
|
|
|
|
|
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include
|
|
|
|
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/cube -L.
|
|
|
|
|
|
|
|
MACHDEP := -DGEKKO -DHW_DOL -mogc -mcpu=750 -meabi -mhard-float
|
|
|
|
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
|
2013-02-22 20:24:05 +00:00
|
|
|
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
|
|
|
WHOLE_START := -Wl,--whole-archive
|
|
|
|
WHOLE_END := -Wl,--no-whole-archive
|
|
|
|
endif
|
|
|
|
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map
|
|
|
|
ifeq ($(BIG_STACK), 1)
|
|
|
|
LDFLAGS += -T gx/ld/ogc.ld
|
|
|
|
endif
|
|
|
|
LIBS := -lfat $(WHOLE_START) -lretro_ngc $(WHOLE_END) -logc
|
2012-08-29 19:15:24 +00:00
|
|
|
|
2013-03-18 04:46:19 +00:00
|
|
|
OBJ = griffin/griffin.o
|
2012-08-29 19:15:24 +00:00
|
|
|
|
2012-10-01 22:47:20 +00:00
|
|
|
ifeq ($(PERF_TEST), 1)
|
|
|
|
CFLAGS += -DPERF_TEST
|
|
|
|
endif
|
|
|
|
|
2012-08-29 19:15:24 +00:00
|
|
|
ifeq ($(HAVE_LOGGER), 1)
|
|
|
|
CFLAGS += -DHAVE_LOGGER
|
|
|
|
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
|
|
|
CFLAGS += -Iconsole/logger
|
2012-09-01 00:47:54 +00:00
|
|
|
LIBS += -lbba
|
2012-08-29 19:15:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(HAVE_FILE_LOGGER), 1)
|
|
|
|
CFLAGS += -DHAVE_FILE_LOGGER
|
|
|
|
CFLAGS += -Iconsole/logger
|
|
|
|
endif
|
|
|
|
|
2013-03-14 20:55:10 +00:00
|
|
|
CFLAGS += -std=gnu99 -DHAVE_RGUI -DRARCH_CONSOLE -DGEKKO -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Wno-char-subscripts
|
2012-08-29 19:15:24 +00:00
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS += -O0 -g
|
|
|
|
else
|
|
|
|
CFLAGS += -O3
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(DOL_TARGET)
|
|
|
|
|
|
|
|
%.dol: %.elf
|
|
|
|
$(ELF2DOL) $< $@
|
|
|
|
|
|
|
|
$(ELF_TARGET): $(OBJ)
|
|
|
|
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.binobj: %.bin
|
|
|
|
$(LD) -r -b binary -o $@ $<
|
|
|
|
|
2012-09-03 22:05:23 +00:00
|
|
|
%.bmpobj: %.bmp
|
|
|
|
$(LD) -r -b binary -o $@ $<
|
2012-08-31 23:38:12 +00:00
|
|
|
|
2012-08-29 19:15:24 +00:00
|
|
|
pkg: all
|
2012-09-03 22:05:23 +00:00
|
|
|
cp -r $(DOL_TARGET) ngc/pkg/CORE.dol
|
2012-08-29 19:15:24 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(DOL_TARGET)
|
|
|
|
rm -f $(ELF_TARGET)
|
|
|
|
rm -f $(OBJ)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|