From f95a4a932476be2ba99e2fd081e8d2bc6ea12813 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 15 Dec 2017 09:38:53 -0500 Subject: Import newlib and create makefile --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bb5a2ed..a5a0180 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ LD := $(DEVKITARM)/bin/arm-none-eabi-ld OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy LIBGCC := tools/agbcc/lib/libgcc.a +LIBC := newlib/libc.a +LIBM := newlib/libm.a MD5 := md5sum -c @@ -62,6 +64,7 @@ tidy: rm -f $(C_SRCS:%.c=%.i) rm -f $(C_SRCS:%.c=%.s) rm -f *.ld + make -C newlib clean src/agb_flash.o: CFLAGS := -O -mthumb-interwork src/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork @@ -91,8 +94,11 @@ sym_iwram.ld: sym_iwram.txt ld_script.ld: ld_script.txt sym_ewram.ld sym_ewram2.ld sym_iwram.ld sed -f ld_script.sed ld_script.txt >ld_script.ld -pmd_red.elf: ld_script.ld $(OBJS) - $(LD) -T ld_script.ld -Map pmd_red.map -o $@ $(OBJS) $(LIBGCC) +$(LIBC) $(LIBM): + make -C newlib + +pmd_red.elf: ld_script.ld $(OBJS) $(LIBC) $(LIBM) + $(LD) -T ld_script.ld -Map pmd_red.map -o $@ $(OBJS) $(LIBGCC) # $(LIBC) $(LIBM) pmd_red.gba: pmd_red.elf $(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0xA000000 $< $@ -- cgit v1.2.3