diff options
author | Michael Panzlaff <michael.panzlaff@fau.de> | 2020-05-05 00:05:37 +0200 |
---|---|---|
committer | Michael Panzlaff <michael.panzlaff@fau.de> | 2020-05-05 00:09:06 +0200 |
commit | c11fb6a3fd417e32306cadebd74352ce4ac6423f (patch) | |
tree | 30cd677c88732e29641f1318272ac847542b0539 | |
parent | b398ef344f4a8b1c147c76cfa0655c2a932fa15b (diff) |
Fix MODERN=1 for non-devkitARM compilation
gcc has this nice option "-print-file-name=" to locate a file
in its search path. This is a more portable way to locate
libgcc.a and libc.a so there is no longer the need to mess around with
devkitARM's path's.
-rw-r--r-- | Makefile | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -59,8 +59,6 @@ MID_BUILDDIR = $(OBJ_DIR)/$(MID_SUBDIR) ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN) -GCC_VER = $(shell $(CC) -dumpversion) - ifeq ($(MODERN),0) CC1 := tools/agbcc/bin/agbcc$(EXE) override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm @@ -72,7 +70,7 @@ CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast ROM := pokeemerald_modern.gba OBJ_DIR := build/modern -LIBPATH := -L $(TOOLCHAIN)/lib/gcc/arm-none-eabi/$(GCC_VER)/thumb -L $(TOOLCHAIN)/arm-none-eabi/lib/thumb +LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))" endif CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) |