Full support for modern ARM toolchains

This commit is contained in:
PikalaxALT
2021-04-20 18:35:43 -04:00
parent a005118d7f
commit 1eecfb308c
2 changed files with 10 additions and 5 deletions
+9 -5
View File
@@ -15,12 +15,14 @@ endif
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
LIBSUBDIR := thumb
else
export PATH := $(TOOLCHAIN)/bin:$(PATH)
PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy
export CC := $(PREFIX)gcc
export AS := $(PREFIX)as
LIBSUBDIR := thumb/nofp
endif
export CPP := $(PREFIX)cpp
export LD := $(PREFIX)ld
@@ -42,8 +44,7 @@ LIBPATH := -L ../../tools/agbcc/lib
else
CC1 := $(shell $(CC) --print-prog-name=cc1) -quiet
override CFLAGS += -mthumb -mthumb-interwork -O2 -mtune=arm7tdmi -march=armv4t -mabi=apcs-gnu -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast
#LIBPATH := -L $(TOOLCHAIN)/lib/gcc/arm-none-eabi/$(GCC_VER)/thumb -L $(TOOLCHAIN)/arm-none-eabi/lib/thumb
LIBPATH := -L ../../tools/agbcc/lib
LIBPATH := -L $(shell dirname $(shell $(CC) --print-file-name=libgcc.a)) -L $(shell dirname $(shell $(CC) --print-file-name=libc.a))
endif
CPPFLAGS := -iquote include -D$(GAME_VERSION) -DREVISION=$(GAME_REVISION) -D$(GAME_LANGUAGE) -DMODERN=$(MODERN)
@@ -77,9 +78,12 @@ ASFLAGS := -mcpu=arm7tdmi --defsym $(GAME_VERSION)=1 --defsym REVISION=$(GAME_RE
LDFLAGS = -Map ../../$(MAP)
LIB := $(LIBPATH) -lc -lgcc
#ifneq ($(MODERN),0)
#LIB += -lsysbase
#endif
ifneq ($(MODERN),0)
ifeq ($(TOOLCHAIN),$(DEVKITARM))
LIB += -lsysbase -lc
endif
LIB += -lnosys
endif
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
GFX := tools/gbagfx/gbagfx
+1
View File
@@ -29,6 +29,7 @@ SECTIONS {
/* COMMON starts at 0x30022A8 */
*(COMMON);
end = .;
__end__ = .;
. = 0x8000;
}