make TOOLCHAIN_PATH configurable

This commit is contained in:
Henny022p 2023-02-26 14:20:26 +01:00
parent 9924c4086a
commit 54fc93770c
1 changed files with 13 additions and 7 deletions

View File

@ -2,21 +2,27 @@
# compiler # compiler
# ======== # ========
ifndef TOOLCHAIN_PATH
ifneq (,$(shell which arm-none-eabi-gcc)) ifneq (,$(shell which arm-none-eabi-gcc))
PREFIX := TOOLCHAIN_PATH :=
else ifdef DEVKITARM else ifdef DEVKITARM
PREFIX := $(DEVKITARM)/bin/ TOOLCHAIN_PATH := $(DEVKITARM)/bin/
else else
$(error arm-none-eabi-gcc not found, please install (devkitPro supported)) $(error arm-none-eabi-gcc not found, please install (devkitPro supported))
endif endif
endif
# ensure trailing slash
ifneq ($(TOOLCHAIN_PATH),)
override TOOLCHAIN_PATH:=$(TOOLCHAIN_PATH)/
endif
CC := $(PREFIX)arm-none-eabi-gcc CC := $(TOOLCHAIN_PATH)arm-none-eabi-gcc
CPP := $(CC) -E CPP := $(CC) -E
CXX := $(PREFIX)arm-none-eabi-g++ CXX := $(TOOLCHAIN_PATH)arm-none-eabi-g++
AS := $(PREFIX)arm-none-eabi-as AS := $(TOOLCHAIN_PATH)arm-none-eabi-as
LD := $(PREFIX)arm-none-eabi-ld LD := $(TOOLCHAIN_PATH)arm-none-eabi-ld
OBJCOPY := $(PREFIX)arm-none-eabi-objcopy OBJCOPY := $(TOOLCHAIN_PATH)arm-none-eabi-objcopy
# ============ # ============
# custom tools # custom tools