Don't hardcode gcc version

This commit is contained in:
GaryOderNichts 2023-07-23 01:55:05 +02:00
parent a7e0f61c8a
commit 0d6def9490

View File

@ -6,7 +6,9 @@ ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>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