From 489f90b8324d3e395d41e94a0d97f2b39463854e Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 22 May 2018 16:05:56 -0500 Subject: [PATCH] Update Makefile with help from devkitPro maintainers --- Makefile | 15 +++---- ld_script.txt | 112 +++++++++++++++++++++++++------------------------- sym_bss.txt | 6 +-- 3 files changed, 64 insertions(+), 69 deletions(-) diff --git a/Makefile b/Makefile index c38d8fe76b..a27584cb2e 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +include $(DEVKITARM)/base_tools +export CPP := $(PREFIX)cpp +export LD := $(PREFIX)ld + SHELL := /bin/bash -o pipefail ROM := pokeemerald.gba @@ -16,25 +20,16 @@ ASM_BUILDDIR = $(OBJ_DIR)/$(ASM_SUBDIR) DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR) SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR) -AS := $(DEVKITARM)/bin/arm-none-eabi-as ASFLAGS := -mcpu=arm7tdmi CC1 := tools/agbcc/bin/agbcc override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef -LD := $(DEVKITARM)/bin/arm-none-eabi-ld LDFLAGS = -Map ../../$(MAP) -OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy - -ifeq ($(OS),Windows_NT) - LIB := ../../tools/agbcc/lib/libgcc.a ../../tools/agbcc/lib/libc.a -else - LIB := -L ../../tools/agbcc/lib -lgcc -lc -endif +LIB := -L ../../tools/agbcc/lib -lgcc -lc SHA1 := sha1sum -c diff --git a/ld_script.txt b/ld_script.txt index 75b9dbb3b6..6aff241190 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -31,7 +31,7 @@ SECTIONS { /* COMMON starts at 0x30022A8 */ - tools/agbcc/lib/libc.a:sbrkr.o(COMMON); + *libc.a:sbrkr.o(COMMON); end = .; . = 0x8000; } @@ -303,56 +303,56 @@ SECTIONS { src/librfu_rfu.o(.text); asm/librfu.o(.text); asm/libagbsyscall.o(.text); - tools/agbcc/lib/libgcc.a:_call_via_rX.o(.text); - tools/agbcc/lib/libgcc.a:_divdi3.o(.text); - tools/agbcc/lib/libgcc.a:_divsi3.o(.text); - tools/agbcc/lib/libgcc.a:_dvmd_tls.o(.text); - tools/agbcc/lib/libgcc.a:_fixunsdfsi.o(.text); - tools/agbcc/lib/libgcc.a:_fixunssfsi.o(.text); - tools/agbcc/lib/libgcc.a:_modsi3.o(.text); - tools/agbcc/lib/libgcc.a:_muldi3.o(.text); - tools/agbcc/lib/libgcc.a:_udivdi3.o(.text); - tools/agbcc/lib/libgcc.a:_udivsi3.o(.text); - tools/agbcc/lib/libgcc.a:_umodsi3.o(.text); - tools/agbcc/lib/libgcc.a:dp-bit.o(.text); - tools/agbcc/lib/libgcc.a:fp-bit.o(.text); - tools/agbcc/lib/libgcc.a:_lshrdi3.o(.text); - tools/agbcc/lib/libgcc.a:_negdi2.o(.text); - tools/agbcc/lib/libc.a:memcpy.o(.text); - tools/agbcc/lib/libc.a:memset.o(.text); - tools/agbcc/lib/libc.a:strcmp.o(.text); - tools/agbcc/lib/libc.a:strcpy.o(.text); - tools/agbcc/lib/libc.a:vfprintf.o(.text); - tools/agbcc/lib/libc.a:vsprintf.o(.text); - tools/agbcc/lib/libc.a:fvwrite.o(.text); - tools/agbcc/lib/libc.a:locale.o(.text); - tools/agbcc/lib/libc.a:findfp.o(.text); - tools/agbcc/lib/libc.a:fflush.o(.text); - tools/agbcc/lib/libc.a:wsetup.o(.text); - tools/agbcc/lib/libc.a:mbtowc_r.o(.text); - tools/agbcc/lib/libc.a:s_isinf.o(.text); - tools/agbcc/lib/libc.a:s_isnan.o(.text); - tools/agbcc/lib/libc.a:memchr.o(.text); - tools/agbcc/lib/libc.a:strlen.o(.text); - tools/agbcc/lib/libc.a:dtoa.o(.text); - tools/agbcc/lib/libc.a:memmove.o(.text); - tools/agbcc/lib/libc.a:stdio.o(.text); - tools/agbcc/lib/libc.a:mprec.o(.text); - tools/agbcc/lib/libc.a:mallocr.o(.text); - tools/agbcc/lib/libc.a:fwalk.o(.text); - tools/agbcc/lib/libc.a:freer.o(.text); - tools/agbcc/lib/libc.a:makebuf.o(.text); - tools/agbcc/lib/libc.a:readr.o(.text); - tools/agbcc/lib/libc.a:writer.o(.text); - tools/agbcc/lib/libc.a:lseekr.o(.text); - tools/agbcc/lib/libc.a:closer.o(.text); - tools/agbcc/lib/libc.a:callocr.o(.text); - tools/agbcc/lib/libc.a:sbrkr.o(.text); - tools/agbcc/lib/libc.a:mlock.o(.text); - tools/agbcc/lib/libc.a:fstatr.o(.text); - tools/agbcc/lib/libc.a:libcfunc.o(.text); - tools/agbcc/lib/libc.a:syscalls.o(.text); - tools/agbcc/lib/libc.a:errno.o(.text); + *libgcc.a:_call_via_rX.o(.text); + *libgcc.a:_divdi3.o(.text); + *libgcc.a:_divsi3.o(.text); + *libgcc.a:_dvmd_tls.o(.text); + *libgcc.a:_fixunsdfsi.o(.text); + *libgcc.a:_fixunssfsi.o(.text); + *libgcc.a:_modsi3.o(.text); + *libgcc.a:_muldi3.o(.text); + *libgcc.a:_udivdi3.o(.text); + *libgcc.a:_udivsi3.o(.text); + *libgcc.a:_umodsi3.o(.text); + *libgcc.a:dp-bit.o(.text); + *libgcc.a:fp-bit.o(.text); + *libgcc.a:_lshrdi3.o(.text); + *libgcc.a:_negdi2.o(.text); + *libc.a:memcpy.o(.text); + *libc.a:memset.o(.text); + *libc.a:strcmp.o(.text); + *libc.a:strcpy.o(.text); + *libc.a:vfprintf.o(.text); + *libc.a:vsprintf.o(.text); + *libc.a:fvwrite.o(.text); + *libc.a:locale.o(.text); + *libc.a:findfp.o(.text); + *libc.a:fflush.o(.text); + *libc.a:wsetup.o(.text); + *libc.a:mbtowc_r.o(.text); + *libc.a:s_isinf.o(.text); + *libc.a:s_isnan.o(.text); + *libc.a:memchr.o(.text); + *libc.a:strlen.o(.text); + *libc.a:dtoa.o(.text); + *libc.a:memmove.o(.text); + *libc.a:stdio.o(.text); + *libc.a:mprec.o(.text); + *libc.a:mallocr.o(.text); + *libc.a:fwalk.o(.text); + *libc.a:freer.o(.text); + *libc.a:makebuf.o(.text); + *libc.a:readr.o(.text); + *libc.a:writer.o(.text); + *libc.a:lseekr.o(.text); + *libc.a:closer.o(.text); + *libc.a:callocr.o(.text); + *libc.a:sbrkr.o(.text); + *libc.a:mlock.o(.text); + *libc.a:fstatr.o(.text); + *libc.a:libcfunc.o(.text); + *libc.a:syscalls.o(.text); + *libc.a:errno.o(.text); src/libisagbprn.o(.text); } =0 @@ -1091,11 +1091,11 @@ SECTIONS { src/agb_flash_le.o(.rodata); src/siirtc.o(.rodata); data/librfu_rodata.o(.rodata); - tools/agbcc/lib/libgcc.a:_divdi3.o(.rodata); - tools/agbcc/lib/libgcc.a:_udivdi3.o(.rodata); - tools/agbcc/lib/libc.a(.rodata); - tools/agbcc/lib/libc.a(.data); - tools/agbcc/lib/libc.a:syscalls.o(.rodata); + *libgcc.a:_divdi3.o(.rodata); + *libgcc.a:_udivdi3.o(.rodata); + *libc.a(.rodata); + *libc.a(.data); + *libc.a:syscalls.o(.rodata); src/libisagbprn.o(.rodata); } =0 diff --git a/sym_bss.txt b/sym_bss.txt index 089f257615..0b861774b1 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -186,6 +186,6 @@ gMPlayTrack_SE3: @ 3001A20 .include "src/agb_flash.o" .include "src/siirtc.o" - .include "tools/agbcc/lib/libgcc.a:dp-bit.o" - .include "tools/agbcc/lib/libgcc.a:fp-bit.o" - .include "tools/agbcc/lib/libc.a:syscalls.o" + .include "*libgcc.a:dp-bit.o" + .include "*libgcc.a:fp-bit.o" + .include "*libc.a:syscalls.o"