2012-06-23 20:08:56 +02:00
|
|
|
PREFIX = $(DEVKITARM)/bin/arm-eabi-
|
|
|
|
CC = $(PREFIX)gcc
|
|
|
|
AS = $(PREFIX)as
|
|
|
|
LD = $(PREFIX)gcc
|
|
|
|
SSTRIP = $(DEVKITARM)/bin/arm-eabi-strip
|
|
|
|
|
|
|
|
CFLAGS = -mbig-endian -fomit-frame-pointer -O2 -Wall -I. -mcpu=arm926ej-s -mthumb
|
|
|
|
CFLAGS += -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-toupper -fno-builtin-memcmp -fno-builtin-malloc -fno-builtin-free
|
|
|
|
|
|
|
|
ASFLAGS = -mbig-endian -mcpu=arm926ej-s
|
|
|
|
|
2012-08-09 02:17:50 +02:00
|
|
|
LDFLAGS = -nostartfiles -nodefaultlibs -mbig-endian -Wl,-T,diosmioslite.ld,-Map,diosmioslite.map -n
|
2012-06-23 20:08:56 +02:00
|
|
|
|
|
|
|
LIBS = -lgcc
|
|
|
|
|
2012-08-09 02:17:50 +02:00
|
|
|
TARGET = diosmioslite.elf
|
|
|
|
OBJECTS = start.o utils_asm.o HW.o Card.o memory.o memory_asm.o Config.o common.o sdhc.o ff.o sdmmc.o diskio.o alloc.o Drive.o DVD.o dip.o Patches.o main.o vsprintf.o string.o
|
2012-06-23 20:08:56 +02:00
|
|
|
.PHONY: FORCE
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
2012-08-09 02:17:50 +02:00
|
|
|
$(TARGET) : diosmioslite.ld $(OBJECTS)
|
2012-06-23 20:08:56 +02:00
|
|
|
@echo "LD $@"
|
|
|
|
@$(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
|
2012-08-09 02:17:50 +02:00
|
|
|
@$(SSTRIP) -s $@
|
2012-06-23 20:08:56 +02:00
|
|
|
|
|
|
|
%.o : %.s
|
|
|
|
@echo "AS $@"
|
|
|
|
@$(CC) $(CFLAGS) -D_LANGUAGE_ASSEMBLY -c -x assembler-with-cpp -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 $@
|
|
|
|
|
2012-08-09 02:17:50 +02:00
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
2012-06-23 20:08:56 +02:00
|
|
|
-include $(OBJECTS:.o=.d)
|
2012-08-09 02:17:50 +02:00
|
|
|
endif
|
2012-06-23 20:08:56 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.elf *.o *.bin *.d *.map
|