mirror of
https://github.com/lowRISC/ibex.git
synced 2025-06-28 09:17:17 -04:00
[sw] Fix GNU GCC toolchain component substitution for file path case.
This invocation would break: make -C examples/sw/led/ CC=/opt/lowrisc-toolchain-gcc-rv32imc-20210412-1/bin/riscv32-unknown-elf-gcc because the "-gcc" occurence inside the directory name would also be replaced. Fix by first deriving CROSS_COMPILE from CC, then conditionally build other tool file names/paths. Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
This commit is contained in:
parent
a0582afb4e
commit
7506d4da2a
2 changed files with 6 additions and 4 deletions
|
@ -12,8 +12,9 @@ SRCS = $(PROGRAM).c
|
|||
|
||||
CC = riscv32-unknown-elf-gcc
|
||||
|
||||
OBJCOPY ?= $(subst gcc,objcopy,$(wordlist 1,1,$(CC)))
|
||||
OBJDUMP ?= $(subst gcc,objdump,$(wordlist 1,1,$(CC)))
|
||||
CROSS_COMPILE = $(patsubst %-gcc,%-,$(CC))
|
||||
OBJCOPY ?= $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP ?= $(CROSS_COMPILE)objdump
|
||||
|
||||
LINKER_SCRIPT ?= link.ld
|
||||
CRT ?= crt0.S
|
||||
|
|
|
@ -21,8 +21,9 @@ ASM_SRCS = $(filter %.S, $(SRCS))
|
|||
|
||||
CC = riscv32-unknown-elf-gcc
|
||||
|
||||
OBJCOPY ?= $(subst gcc,objcopy,$(wordlist 1,1,$(CC)))
|
||||
OBJDUMP ?= $(subst gcc,objdump,$(wordlist 1,1,$(CC)))
|
||||
CROSS_COMPILE = $(patsubst %-gcc,%-,$(CC))
|
||||
OBJCOPY ?= $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP ?= $(CROSS_COMPILE)objdump
|
||||
|
||||
LINKER_SCRIPT ?= $(COMMON_DIR)/link.ld
|
||||
CRT ?= $(COMMON_DIR)/crt0.S
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue