Build system cleanup, less c&p ftw.

This commit is contained in:
dhewg 2009-04-04 18:59:31 +02:00 committed by bushing
parent 13bcec0a91
commit d8440368d9

View File

@ -1,47 +1,30 @@
include ../../toolchain.rules include ../../starlet.mk
CFLAGS = -mbig-endian -fomit-frame-pointer -Os -Wall -I. -mcpu=arm926ej-s CFLAGS += -Os -Wall -I.
ASFLAGS = -mbig-endian -mcpu=arm926ej-s ASFLAGS += -D_LANGUAGE_ASSEMBLY
LDFLAGS = -nostartfiles -nodefaultlibs -mbig-endian -Wl,-T,mini.ld,-Map,mini.map -n LDFLAGS += -nostartfiles -nodefaultlibs -Tmini.ld
LIBS = -lgcc LIBS = -lgcc
ELFLOADER = ../elfloader/elfloader.bin ELFLOADER = ../elfloader/elfloader.bin
MAKEBIN = python ../makebin.py MAKEBIN = python ../makebin.py
TARGET = armboot.bin TARGET = armboot.elf
ELF = armboot.elf TARGET_BIN = armboot.bin
OBJECTS = start.o main.o ipc.o vsprintf.o string.o gecko.o memory.o memory_asm.o \ OBJS = start.o main.o ipc.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 irq.o irq_asm.o \ utils_asm.o utils.o ff.o diskio.o sdhc.o powerpc_elf.o powerpc.o panic.o \
exception.o exception_asm.o seeprom.o crypto.o nand.o boot2.o ldhack.o irq.o irq_asm.o exception.o exception_asm.o seeprom.o crypto.o nand.o \
boot2.o ldhack.o
$(TARGET) : $(ELF) $(ELFLOADER) include ../../common.mk
all: $(TARGET_BIN)
$(TARGET_BIN): $(TARGET) $(ELFLOADER)
@echo "MAKEBIN $@" @echo "MAKEBIN $@"
@$(MAKEBIN) $(ELFLOADER) $< $@ @$(MAKEBIN) $(ELFLOADER) $< $@
$(ELF) : mini.ld $(OBJECTS) clean: myclean
@echo "LD $@"
@$(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
%.o : %.S myclean:
@echo "AS $@" -rm -f mini.bin
@$(CC) $(CFLAGS) -D_LANGUAGE_ASSEMBLY -c -x assembler-with-cpp -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 *.map