ARM = /home/Predi/GP32/devkitARM_r8
NAME = test
TITLE = Official Test Program
FILES = gpmain.c
AUTHOR = R0x0r Elite
ICON =
ICONCMD = -b "$(ICON)"
LIBS = -lgpfont -lgpstdlib -lgpos -lgpgraphic -lgpstdio -lgpsound -lgpmem
PREFIX = arm-elf-
FLAGS = $(incdirs) -DLITTLE_ENDIAN -DGP32 -mcpu=arm9tdmi -mtune=arm9tdmi -fexpensive-optimizations -mapcs -Os -mstructure-size-boundary=8 -mno-thumb-interwork -fno-builtin -fno-common -fno-exceptions -finline-functions -fomit-frame-pointer -fshort-enums -ffast-math -fshort-double -I$(ARM)/include -c
LDFLAGS = -specs=gp32_gpsdk.specs -o $(NAME).elf *.o $(ARM)/lib/gpstart.o
TARGET = $(NAME).fxe
CC = $(ARM)/bin/$(PREFIX)gcc
all: $(TARGET)
cleanobjs:
@rm *.o
cleanbin:
@rm $(NAME).fxe $(NAME).gxb $(NAME).elf
clean: cleanobjs cleanbin
@echo "Project Cleaned"
$(TARGET): $(NAME).gxb
@$(ARM)/bin/b2fxec -t "$(TITLE)" -a "$(AUTHOR)" $? $@
$(NAME).gxb: $(NAME).elf
@$(ARM)/bin/$(PREFIX)objcopy -O binary $? $@
$(NAME).elf:
@$(CC) $(FLAGS) $(FILES)
@$(CC) $(LDFLAGS) $(LIBS)