2008-12-28 14:35:37 +01:00
|
|
|
CC = arm-eabi-gcc
|
|
|
|
AS = arm-eabi-as
|
|
|
|
LD = arm-eabi-gcc
|
|
|
|
OBJCOPY = arm-eabi-objcopy
|
2009-01-06 00:13:39 +01:00
|
|
|
CFLAGS = -mbig-endian -fomit-frame-pointer -Os -Wall -I.
|
2008-12-28 14:35:37 +01:00
|
|
|
ASFLAGS = -mbig-endian
|
2009-01-06 00:13:39 +01:00
|
|
|
LDFLAGS = -nostartfiles -mbig-endian -Wl,-T,miniios.ld -n
|
2008-12-28 14:35:37 +01:00
|
|
|
|
2009-01-06 00:13:39 +01:00
|
|
|
ELFLOADER = ../elfloader/elfloader.bin
|
|
|
|
MAKEBIN = python ../makebin.py
|
|
|
|
|
|
|
|
TARGET = miniios.bin
|
|
|
|
ELF = miniios.elf
|
2008-12-28 14:35:37 +01:00
|
|
|
OBJECTS = start.o main.o vsprintf.o string.o gecko.o memory.o memory_asm.o \
|
|
|
|
utils_asm.o utils.o ff.o diskio.o sdhc.o powerpc_elf.o powerpc.o panic.o
|
|
|
|
|
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 $@"
|
|
|
|
@$(LD) $(LDFLAGS) $(OBJECTS) -o $@
|
|
|
|
|
|
|
|
%.o : %.S
|
|
|
|
@echo "AS $@"
|
|
|
|
@$(AS) $(ASFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
%.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:
|
|
|
|
-rm -f *.elf *.o *.bin *.d
|
|
|
|
|