2014-03-23 21:14:59 +01:00
|
|
|
export PATH := $(DEVKITPPC)/bin:$(PATH)
|
2014-03-23 18:40:31 +01:00
|
|
|
PREFIX = powerpc-eabi-
|
|
|
|
|
|
|
|
AR = $(PREFIX)ar
|
|
|
|
AS = $(PREFIX)as
|
|
|
|
CC = $(PREFIX)gcc
|
|
|
|
CXX = $(PREFIX)g++
|
|
|
|
LD = $(PREFIX)ld
|
|
|
|
OBJCOPY = $(PREFIX)objcopy
|
|
|
|
RANLIB = $(PREFIX)ranlib
|
|
|
|
STRIP = $(PREFIX)strip
|
|
|
|
|
2014-03-24 19:59:24 +01:00
|
|
|
MACHDEP = -mcpu=750 -mno-eabi
|
|
|
|
CFLAGS = $(MACHDEP) -O1 -Werror -Wall -pipe -mno-sdata
|
2014-03-23 18:40:31 +01:00
|
|
|
LDFLAGS = $(MACHDEP) -n -nostartfiles -nostdlib -Wl,-T,link.ld -L.
|
2014-03-31 20:31:24 +02:00
|
|
|
ASFLAGS = -D_LANGUAGE_ASSEMBLY -DHW_RVL -x assembler-with-cpp
|
2014-03-23 18:40:31 +01:00
|
|
|
|
|
|
|
TARGET_LINKED = boot.elf
|
2014-03-24 19:59:24 +01:00
|
|
|
TARGET = extldr.bin
|
2014-03-23 18:40:31 +01:00
|
|
|
|
2014-03-31 16:33:24 +02:00
|
|
|
CFILES = string.c ios.c utils.c cache.c usbgecko.c main.c
|
2014-03-31 20:14:46 +02:00
|
|
|
OBJS = crt0.o memory.o string.o ios.o utils.o cache.o usbgecko.o main.o
|
2014-03-23 18:40:31 +01:00
|
|
|
|
|
|
|
DEPDIR = .deps
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
@echo "$<"
|
|
|
|
@$(CC) $(CFLAGS) $(DEFINES) $(ASFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
@echo "$<"
|
|
|
|
@$(CC) $(CFLAGS) $(DEFINES) $(ASFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
@echo "$<"
|
|
|
|
@$(CC) $(CFLAGS) $(DEFINES) -c $< -o $@
|
|
|
|
|
|
|
|
$(TARGET_LINKED): $(OBJS)
|
|
|
|
@echo "linking ... $@"
|
|
|
|
@$(CC) -g -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
|
|
|
|
|
|
|
|
$(TARGET): $(TARGET_LINKED)
|
|
|
|
@echo "output ... $@"
|
|
|
|
@$(OBJCOPY) -O binary $< $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "clean ..."
|
|
|
|
@rm -rf $(TARGET_LINKED) $(TARGET) $(OBJS) $(DEPDIR)
|