RetroArch/wii/app_booter/Makefile
2015-02-19 00:04:03 +01:00

56 lines
1.2 KiB
Makefile

###
##
# Makefile for app_booter.
##
# 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)
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
OBJCOPY = $(DEVKITPPC)/bin/powerpc-eabi-objcopy$(EXE_EXT)
BIN_TARGET := app_booter.bin
ELF_TARGET := app_booter.elf
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include -I../../libretro-common/crt/include
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/wii
MACHDEP := -DHW_RVL -DGEKKO -mno-eabi -mno-sdata -mcpu=750
# todo: find out why -Os spits out linker errors
CFLAGS += -Wall -O2 -ffreestanding -std=gnu99 $(MACHDEP) $(INCLUDE)
LDFLAGS := -T link.ld
OBJ = crt0.o dolloader.o elfloader.o main.o ../../libretro-common/crt/string.o sync.o
all: $(BIN_TARGET)
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
$(ELF_TARGET): $(OBJ)
$(LD) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.s
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(BIN_TARGET)
rm -f $(ELF_TARGET)
rm -f $(OBJ)
.PHONY: clean