ifeq ($(strip $(DEVKITPPC)),) $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") endif ifeq ($(filter $(DEVKITPPC)/bin,$(PATH)),) export PATH:=$(DEVKITPPC)/bin:$(PATH) endif CC = powerpc-eabi-gcc LINK = powerpc-eabi-ld AS = powerpc-eabi-as OBJCOPY = powerpc-eabi-objcopy CFLAGS += -Wall -mbig-endian -mcpu=750 -meabi -std=c99 -O2 LDFLAGS += --script=ccd00.ld -EB -L"$(DEVKITPPC)/powerpc-eabi/lib" -Map=output.map -lm -lg -lc CFILES = $(wildcard source/*.c) BINFILES = $(wildcard data/*.bin) OFILES = $(BINFILES:data/%.bin=build/%.bin.o) OFILES += $(CFILES:source/%.c=build/%.o) DFILES = $(CFILES:source/%.c=build/%.d) SFILES = $(wildcard source/*.s) OFILES += $(SFILES:source/%.s=build/%.o) PROJECTNAME = ${shell basename "$(CURDIR)"} CWD = "$(CURDIR)"" #--------------------------------------------------------------------------------- # canned command sequence for binary data, taken from devkitPPC #--------------------------------------------------------------------------------- define bin2o bin2s $< | $(AS) -o $(@) echo "extern const u8" `(echo $( source/`(echo $(> source/`(echo $(> source/`(echo $( build/$*.d build/%.o: source/%.s $(CC) $(CFLAGS) -xassembler-with-cpp -c $< -o $@ @$(CC) -MM $< > build/$*.d build/%.bin.o: data/%.bin @echo $(notdir $<) @$(bin2o)