2009-01-07 17:56:57 +01:00
|
|
|
include ../toolchain.rules
|
|
|
|
|
2009-01-14 03:41:06 +01:00
|
|
|
CFLAGS = -mbig-endian -fomit-frame-pointer -Os -Wall -I. -mcpu=arm926ej-s
|
|
|
|
ASFLAGS = -mbig-endian -mcpu=arm926ej-s
|
2009-01-07 17:56:57 +01:00
|
|
|
LDFLAGS = -nostartfiles -nodefaultlibs -mbig-endian -Wl,-T,miniios.ld,-Map,miniios.map -n
|
|
|
|
LIBS = -lgcc
|
2008-12-28 14:35:37 +01:00
|
|
|
|
2009-01-06 00:13:39 +01:00
|
|
|
ELFLOADER = ../elfloader/elfloader.bin
|
|
|
|
MAKEBIN = python ../makebin.py
|
|
|
|
|
2009-01-27 13:32:03 +01:00
|
|
|
TARGET = iosboot.bin
|
|
|
|
ELF = iosboot.elf
|
2009-01-25 04:04:19 +01:00
|
|
|
OBJECTS = start.o main.o ipc.o vsprintf.o string.o gecko.o memory.o memory_asm.o \
|
2009-01-16 08:53:57 +01:00
|
|
|
utils_asm.o utils.o ff.o diskio.o sdhc.o powerpc_elf.o powerpc.o panic.o irq.o irq_asm.o \
|
2009-02-24 16:20:28 +01:00
|
|
|
exception.o exception_asm.o seeprom.o crypto.o nand.o boot2.o
|
2008-12-28 14:35:37 +01:00
|
|
|
|
2009-01-06 00:13:39 +01:00
|
|
|
$(TARGET) : $(ELF) $(ELFLOADER)
|
|
|
|
@echo "MAKEBIN $@"
|
|
|
|
@$(MAKEBIN) $(ELFLOADER) $< $@
|
2008-12-28 14:35:37 +01:00
|
|
|
|
2009-01-06 00:13:39 +01:00
|
|
|
$(ELF) : miniios.ld $(OBJECTS)
|
2008-12-28 14:35:37 +01:00
|
|
|
@echo "LD $@"
|
2009-01-07 17:56:57 +01:00
|
|
|
@$(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
|
2008-12-28 14:35:37 +01:00
|
|
|
|
|
|
|
%.o : %.S
|
|
|
|
@echo "AS $@"
|
2009-01-08 23:27:22 +01:00
|
|
|
@$(CC) $(CFLAGS) -D_LANGUAGE_ASSEMBLY -c -x assembler-with-cpp -o $@ $<
|
2008-12-28 14:35:37 +01:00
|
|
|
|
|
|
|
%.o : %.c
|
|
|
|
@echo "CC $@"
|
|
|
|
@$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.d: %.c
|
|
|
|
@echo "DEP $@"
|
|
|
|
@set -e; $(CC) -M $(CFLAGS) $< \
|
|
|
|
| sed 's?\($*\)\.o[ :]*?\1.o $@ : ?g' > $@; \
|
|
|
|
[ -s $@ ] || rm -f $@
|
|
|
|
|
|
|
|
%.d: %.S
|
|
|
|
@echo "DEP $@"
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
-include $(OBJECTS:.o=.d)
|
|
|
|
|
|
|
|
clean:
|
2009-01-07 17:56:46 +01:00
|
|
|
-rm -f *.elf *.o *.bin *.d *.map
|
2008-12-28 14:35:37 +01:00
|
|
|
|