From 0d6def94900d1c94e9acdcaffb656f0a070226f4 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Sun, 23 Jul 2023 01:55:05 +0200 Subject: [PATCH] Don't hardcode gcc version --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index eb1813e..687e1a6 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,9 @@ ifeq ($(strip $(DEVKITARM)),) $(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") endif -include $(DEVKITARM)/ds_rules +include $(DEVKITARM)/base_rules + +GCC_VERSION := $(shell $(CC) -dumpversion) #--------------------------------------------------------------------------------- # TARGET is the name of the output @@ -44,7 +46,7 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions ASFLAGS := -g $(ARCH) $(DEFINES) LDFLAGS = -n -nostartfiles -g --specs=../stage2/link.specs $(ARCH) -Wl,--gc-sections,-Map,$(TARGET).map \ - -L$(DEVKITARM)/lib/gcc/arm-none-eabi/5.3.0/be -L$(DEVKITARM)/arm-none-eabi/lib/be + -L$(DEVKITARM)/lib/gcc/arm-none-eabi/$(GCC_VERSION)/be -L$(DEVKITARM)/arm-none-eabi/lib/be LIBS := @@ -140,6 +142,8 @@ $(TARGET)-strip.elf: $(TARGET).elf @$(STRIP) $< -o $@ $(TARGET).elf: $(OFILES) + $(SILENTMSG) linking $(notdir $@) + $(SILENTCMD)$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@ $(ELFLOADER): @$(MAKE) -C $(ROOTDIR)/stage2ldr