CfgUSBLoader/cios/sdhc_orig/Makefile
2015-01-17 10:11:08 +00:00

54 lines
1.0 KiB
Makefile

# devkitARM path
DEVKITARM ?= /opt/devkitARM
# Prefix
PREFIX = $(DEVKITARM)/bin/arm-eabi-
# Executables
CC = $(PREFIX)gcc
LD = $(PREFIX)gcc
STRIP = ./stripios
# Flags
ARCH = -mcpu=arm926ej-s -mthumb -mthumb-interwork -mbig-endian
CFLAGS = $(ARCH) -I. -fomit-frame-pointer -Os -Wall -Wstrict-prototypes -ffunction-sections
LDFLAGS = $(ARCH) -nostartfiles -Wl,-T,link.ld,-Map,$(TARGET).map -Wl,--gc-sections -Wl,-static
# Libraries
LIBS =
# Target
TARGET = sdhc-module
# Objects
OBJS = es.o \
ipc.o \
main.o \
mem.o \
sdio.o \
start.o \
syscalls.o \
timer.o \
wbfs.o \
libwbfs/libwbfs.o \
libwbfs/rijndael.o \
libwbfs/wiidisc.o
$(TARGET).elf: $(OBJS)
@echo -e " LD\t$@"
@$(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $@.orig
@$(STRIP) $@.orig $@
%.o: %.s
@echo -e " CC\t$@"
@$(CC) $(CFLAGS) -D_LANGUAGE_ASSEMBLY -c -x assembler-with-cpp -o $@ $<
%.o: %.c
@echo -e " CC\t$@"
@$(CC) $(CFLAGS) -c -o $@ $<
clean:
@echo -e "Cleaning..."
@rm -f $(OBJS) $(TARGET).elf $(TARGET).elf.orig $(TARGET).map