mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-05 19:25:12 +01:00
47 lines
1.1 KiB
Makefile
47 lines
1.1 KiB
Makefile
include ../toolchain.rules
|
|
|
|
CFLAGS = -mbig-endian -fomit-frame-pointer -Os -Wall -I.
|
|
ASFLAGS = -mbig-endian
|
|
LDFLAGS = -nostartfiles -nodefaultlibs -mbig-endian -Wl,-T,miniios.ld,-Map,miniios.map -n
|
|
LIBS = -lgcc
|
|
|
|
ELFLOADER = ../elfloader/elfloader.bin
|
|
MAKEBIN = python ../makebin.py
|
|
|
|
TARGET = miniios.bin
|
|
ELF = miniios.elf
|
|
OBJECTS = start.o ipcstruct.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
|
|
|
|
$(TARGET) : $(ELF) $(ELFLOADER)
|
|
@echo "MAKEBIN $@"
|
|
@$(MAKEBIN) $(ELFLOADER) $< $@
|
|
|
|
$(ELF) : miniios.ld $(OBJECTS)
|
|
@echo "LD $@"
|
|
@$(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
|
|
|
|
%.o : %.S
|
|
@echo "AS $@"
|
|
@$(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
|
|
|