blob: 68be6a12e961b72b40696287240f2c57136415b3 [file] [log] [blame]
Chris Kaycc277de2023-10-20 09:17:33 +00001#
2# Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7#
8# TF-A uses three toolchains:
9#
10# - The host toolchain (`host`) for building native tools
Chris Kay291e7182024-05-14 13:08:31 +000011# - The AArch32 toolchain (`aarch32`) for building Arm AArch32 images
Chris Kaycc277de2023-10-20 09:17:33 +000012# - The AArch64 toolchain (`aarch64`) for building Arm AArch64 images
13#
14# In the main Makefile only one of the two Arm toolchains is enabled in any
15# given build, but individual tools and libraries may need access to both.
16#
17
Chris Kay291e7182024-05-14 13:08:31 +000018ifndef toolchain-mk
19 toolchain-mk := $(lastword $(MAKEFILE_LIST))
Chris Kaycc277de2023-10-20 09:17:33 +000020
Chris Kay291e7182024-05-14 13:08:31 +000021 toolchains ?= host $(ARCH)
Chris Kay4731c002024-04-09 16:30:52 +000022
Chris Kay291e7182024-05-14 13:08:31 +000023 include $(dir $(lastword $(MAKEFILE_LIST)))build_env.mk
24 include $(dir $(lastword $(MAKEFILE_LIST)))utilities.mk
Chris Kaycc277de2023-10-20 09:17:33 +000025
Chris Kay291e7182024-05-14 13:08:31 +000026 include $(addprefix $(dir $(lastword $(MAKEFILE_LIST)))toolchains/, \
27 $(addsuffix .mk,$(toolchains)))
Chris Kaycc277de2023-10-20 09:17:33 +000028
Chris Kay291e7182024-05-14 13:08:31 +000029 #
30 # Configure tool classes that we recognize.
31 #
32 # In the context of this build system, a tool class identifies a
33 # specific role or type of tool in the toolchain.
34 #
Chris Kaycc277de2023-10-20 09:17:33 +000035
Chris Kay14260db2024-06-03 02:01:34 +000036 toolchain-tool-classes := cc
37 toolchain-tool-class-name-cc := C compiler
Chris Kaycc277de2023-10-20 09:17:33 +000038
Chris Kay14260db2024-06-03 02:01:34 +000039 toolchain-tool-classes += cpp
40 toolchain-tool-class-name-cpp := C preprocessor
Chris Kaycc277de2023-10-20 09:17:33 +000041
Chris Kay14260db2024-06-03 02:01:34 +000042 toolchain-tool-classes += as
43 toolchain-tool-class-name-as := assembler
Chris Kay3d6c7e52024-04-16 17:19:20 +000044
Chris Kay14260db2024-06-03 02:01:34 +000045 toolchain-tool-classes += ld
46 toolchain-tool-class-name-ld := linker
Chris Kay3d6c7e52024-04-16 17:19:20 +000047
Chris Kay14260db2024-06-03 02:01:34 +000048 toolchain-tool-classes += oc
49 toolchain-tool-class-name-oc := object copier
Chris Kay3d6c7e52024-04-16 17:19:20 +000050
Chris Kay14260db2024-06-03 02:01:34 +000051 toolchain-tool-classes += od
52 toolchain-tool-class-name-od := object dumper
Chris Kay3d6c7e52024-04-16 17:19:20 +000053
Chris Kay14260db2024-06-03 02:01:34 +000054 toolchain-tool-classes += ar
55 toolchain-tool-class-name-ar := archiver
Chris Kaycc277de2023-10-20 09:17:33 +000056
Chris Kay14260db2024-06-03 02:01:34 +000057 toolchain-tool-classes += dtc
58 toolchain-tool-class-name-dtc := device tree compiler
Chris Kaycc277de2023-10-20 09:17:33 +000059
Chris Kay291e7182024-05-14 13:08:31 +000060 #
61 # Configure tools that we recognize.
62 #
63 # Here we declare the list of specific toolchain tools that we know how
64 # to interact with. We don't organize these into tool classes yet - that
65 # happens further down.
66 #
Chris Kay3d6c7e52024-04-16 17:19:20 +000067
Chris Kay291e7182024-05-14 13:08:31 +000068 # Arm® Compiler for Embedded
Chris Kay14260db2024-06-03 02:01:34 +000069 toolchain-tools := arm-clang
70 toolchain-tool-name-arm-clang := Arm® Compiler for Embedded `armclang`
Chris Kay3d6c7e52024-04-16 17:19:20 +000071
Chris Kay14260db2024-06-03 02:01:34 +000072 toolchain-tools += arm-link
73 toolchain-tool-name-arm-link := Arm® Compiler for Embedded `armlink`
Chris Kay3d6c7e52024-04-16 17:19:20 +000074
Chris Kay14260db2024-06-03 02:01:34 +000075 toolchain-tools += arm-ar
76 toolchain-tool-name-arm-ar := Arm® Compiler for Embedded `armar`
Chris Kaycc277de2023-10-20 09:17:33 +000077
Chris Kay14260db2024-06-03 02:01:34 +000078 toolchain-tools += arm-fromelf
79 toolchain-tool-name-arm-fromelf := Arm® Compiler for Embedded `fromelf`
Chris Kay3d6c7e52024-04-16 17:19:20 +000080
Chris Kay291e7182024-05-14 13:08:31 +000081 # LLVM Project
Chris Kay14260db2024-06-03 02:01:34 +000082 toolchain-tools += llvm-clang
83 toolchain-tool-name-llvm-clang := LLVM Clang (`clang`)
Chris Kay3d6c7e52024-04-16 17:19:20 +000084
Chris Kay14260db2024-06-03 02:01:34 +000085 toolchain-tools += llvm-lld
86 toolchain-tool-name-llvm-lld := LLVM LLD (`lld`)
Chris Kay3d6c7e52024-04-16 17:19:20 +000087
Chris Kay14260db2024-06-03 02:01:34 +000088 toolchain-tools += llvm-objcopy
89 toolchain-tool-name-llvm-objcopy := LLVM `llvm-objcopy`
Chris Kay3d6c7e52024-04-16 17:19:20 +000090
Chris Kay14260db2024-06-03 02:01:34 +000091 toolchain-tools += llvm-objdump
92 toolchain-tool-name-llvm-objdump := LLVM `llvm-objdump`
Chris Kaycc277de2023-10-20 09:17:33 +000093
Chris Kay14260db2024-06-03 02:01:34 +000094 toolchain-tools += llvm-ar
95 toolchain-tool-name-llvm-ar := LLVM `llvm-ar`
Chris Kay3d6c7e52024-04-16 17:19:20 +000096
Chris Kay291e7182024-05-14 13:08:31 +000097 # GNU Compiler Collection & GNU Binary Utilities
Chris Kay14260db2024-06-03 02:01:34 +000098 toolchain-tools += gnu-gcc
99 toolchain-tool-name-gnu-gcc := GNU GCC (`gcc`)
Chris Kay3d6c7e52024-04-16 17:19:20 +0000100
Chris Kay14260db2024-06-03 02:01:34 +0000101 toolchain-tools += gnu-ld
102 toolchain-tool-name-gnu-ld := GNU LD (`ld.bfd`)
Chris Kay3d6c7e52024-04-16 17:19:20 +0000103
Chris Kay14260db2024-06-03 02:01:34 +0000104 toolchain-tools += gnu-objcopy
105 toolchain-tool-name-gnu-objcopy := GNU `objcopy`
Chris Kay3d6c7e52024-04-16 17:19:20 +0000106
Chris Kay14260db2024-06-03 02:01:34 +0000107 toolchain-tools += gnu-objdump
108 toolchain-tool-name-gnu-objdump := GNU `objdump`
Chris Kaycc277de2023-10-20 09:17:33 +0000109
Chris Kay14260db2024-06-03 02:01:34 +0000110 toolchain-tools += gnu-ar
111 toolchain-tool-name-gnu-ar := GNU `ar`
Chris Kaycc277de2023-10-20 09:17:33 +0000112
Chris Kay291e7182024-05-14 13:08:31 +0000113 # Other tools
Chris Kay14260db2024-06-03 02:01:34 +0000114 toolchain-tools += generic-dtc
115 toolchain-tool-name-generic-dtc := Device Tree Compiler (`dtc`)
Chris Kaycc277de2023-10-20 09:17:33 +0000116
Chris Kay291e7182024-05-14 13:08:31 +0000117 #
118 # Assign tools to tool classes.
119 #
120 # Multifunctional tools, i.e. tools which can perform multiple roles in
121 # a toolchain, may be specified in multiple tool class lists. For
122 # example, a C compiler which can also perform the role of a linker may
Chris Kay14260db2024-06-03 02:01:34 +0000123 # be placed in both `toolchain-tools-cc` and `toolchain-tools-ld`.
Chris Kay291e7182024-05-14 13:08:31 +0000124 #
Chris Kaycc277de2023-10-20 09:17:33 +0000125
Chris Kay291e7182024-05-14 13:08:31 +0000126 # C-related tools
Chris Kay14260db2024-06-03 02:01:34 +0000127 toolchain-tools-cc := arm-clang llvm-clang gnu-gcc # C compilers
128 toolchain-tools-cpp := arm-clang llvm-clang gnu-gcc # C preprocessors
Chris Kaycc277de2023-10-20 09:17:33 +0000129
Chris Kay291e7182024-05-14 13:08:31 +0000130 # Assembly-related tools
Chris Kay14260db2024-06-03 02:01:34 +0000131 toolchain-tools-as := arm-clang llvm-clang gnu-gcc # Assemblers
Chris Kaycc277de2023-10-20 09:17:33 +0000132
Chris Kay291e7182024-05-14 13:08:31 +0000133 # Linking and object-handling tools
Chris Kay14260db2024-06-03 02:01:34 +0000134 toolchain-tools-ld := arm-clang arm-link llvm-clang llvm-lld gnu-gcc gnu-ld # Linkers
135 toolchain-tools-oc := arm-fromelf llvm-objcopy gnu-objcopy # Object copiers
136 toolchain-tools-od := arm-fromelf llvm-objdump gnu-objdump # Object dumpers
137 toolchain-tools-ar := arm-ar llvm-ar gnu-ar # Archivers
Chris Kaycc277de2023-10-20 09:17:33 +0000138
Chris Kay291e7182024-05-14 13:08:31 +0000139 # Other tools
Chris Kay14260db2024-06-03 02:01:34 +0000140 toolchain-tools-dtc := generic-dtc # Device tree compilers
Chris Kaycc277de2023-10-20 09:17:33 +0000141
Chris Kay291e7182024-05-14 13:08:31 +0000142 #
143 # Default tools for each toolchain.
144 #
145 # Toolchains can specify a default path to any given tool with a tool
146 # class. These values are used in the absence of user-specified values,
147 # and are configured by the makefile for each toolchain using variables
148 # of the form:
149 #
150 # - $(toolchain)-$(tool-class)-default
151 #
152 # For example, the default C compiler for the AArch32 and AArch64
153 # toolchains could be configured with:
154 #
155 # - aarch32-cc-default
156 # - aarch64-cc-default
157 #
Chris Kaycc277de2023-10-20 09:17:33 +0000158
Chris Kay14260db2024-06-03 02:01:34 +0000159 define toolchain-check-tool-class-default
160 ifndef $(1)-$(tool-class)-default
161 $$(error no default value specified for tool class `$(2)` of toolchain `$(1)`)
Chris Kay291e7182024-05-14 13:08:31 +0000162 endif
163 endef
Chris Kaycc277de2023-10-20 09:17:33 +0000164
Chris Kay14260db2024-06-03 02:01:34 +0000165 define toolchain-check-tool-class-defaults
166 $(foreach tool-class,$(toolchain-tool-classes), \
167 $(eval $(call toolchain-check-tool-class-default,$(1),$(tool-class))))
Chris Kay291e7182024-05-14 13:08:31 +0000168 endef
Chris Kaycc277de2023-10-20 09:17:33 +0000169
Chris Kay291e7182024-05-14 13:08:31 +0000170 $(foreach toolchain,$(toolchains), \
Chris Kay14260db2024-06-03 02:01:34 +0000171 $(eval $(call toolchain-check-tool-class-defaults,$(toolchain))))
Chris Kaycc277de2023-10-20 09:17:33 +0000172
Chris Kay291e7182024-05-14 13:08:31 +0000173 #
174 # Helper functions to identify toolchain tools.
175 #
176 # The functions defined in this section return a tool identifier when
177 # given a path to a binary. We generally check a help or version string
178 # to more reliably identify tools than by looking at the path alone
179 # (e.g. `gcc` on macOS is actually Apple Clang).
180 #
Chris Kay14260db2024-06-03 02:01:34 +0000181 # Each tool-guessing function (`toolchain-guess-tool-$(tool)`) takes a
182 # single argument giving the path to the tool to guess, and returns a
183 # non-empty value if the tool corresponds to the tool identifier
184 # `$(tool)`:
Chris Kay291e7182024-05-14 13:08:31 +0000185 #
Chris Kay14260db2024-06-03 02:01:34 +0000186 # $(call toolchain-guess-tool-llvm-clang,aarch64-none-elf-gcc) # <empty>
187 # $(call toolchain-guess-tool-gnu-gcc,aarch64-none-elf-gcc) # <non-empty>
Chris Kay291e7182024-05-14 13:08:31 +0000188 #
Chris Kay14260db2024-06-03 02:01:34 +0000189 # The `toolchain-guess-tool` function tries to find the corresponding tool
Chris Kay291e7182024-05-14 13:08:31 +0000190 # identifier for a tool given its path. It takes two arguments:
191 #
192 # - $(1): a list of candidate tool identifiers to check
193 # - $(2): the path to the tool to identify
194 #
195 # If any of the guess functions corresponding to candidate tool
196 # identifiers return a non-empty value then the tool identifier of the
197 # first function to do so is returned:
198 #
Chris Kay14260db2024-06-03 02:01:34 +0000199 # $(call toolchain-guess-tool,gnu-gcc llvm-clang,armclang) # <empty>
200 # $(call toolchain-guess-tool,gnu-gcc llvm-clang,clang-14) # llvm-clang
201 # $(call toolchain-guess-tool,gnu-gcc llvm-clang,aarch64-none-elf-gcc-12) # gnu-gcc
Chris Kay291e7182024-05-14 13:08:31 +0000202 #
Chris Kay14260db2024-06-03 02:01:34 +0000203 # Tools are checked in the order that they are provided, and the first
204 # match is returned.
Chris Kay291e7182024-05-14 13:08:31 +0000205 #
Chris Kaycc277de2023-10-20 09:17:33 +0000206
Chris Kay291e7182024-05-14 13:08:31 +0000207 # Arm Compiler for Embedded
Chris Kay14260db2024-06-03 02:01:34 +0000208 toolchain-guess-tool-arm-clang = $(shell $(1) --version 2>&1 <$(nul) | grep -o "Tool: armclang")
209 toolchain-guess-tool-arm-link = $(shell $(1) --help 2>&1 <$(nul) | grep -o "Tool: armlink")
210 toolchain-guess-tool-arm-fromelf = $(shell $(1) --help 2>&1 <$(nul) | grep -o "Tool: fromelf")
211 toolchain-guess-tool-arm-ar = $(shell $(1) --version 2>&1 <$(nul) | grep -o "Tool: armar")
Chris Kaycc277de2023-10-20 09:17:33 +0000212
Chris Kay291e7182024-05-14 13:08:31 +0000213 # LLVM Project
Chris Kay14260db2024-06-03 02:01:34 +0000214 toolchain-guess-tool-llvm-clang = $(shell $(1) -v 2>&1 <$(nul) | grep -o "clang version")
215 toolchain-guess-tool-llvm-lld = $(shell $(1) --help 2>&1 <$(nul) | grep -o "OVERVIEW: lld")
216 toolchain-guess-tool-llvm-objcopy = $(shell $(1) --help 2>&1 <$(nul) | grep -o "llvm-objcopy tool")
217 toolchain-guess-tool-llvm-objdump = $(shell $(1) --help 2>&1 <$(nul) | grep -o "llvm object file dumper")
218 toolchain-guess-tool-llvm-ar = $(shell $(1) --help 2>&1 <$(nul) | grep -o "LLVM Archiver")
Chris Kaycc277de2023-10-20 09:17:33 +0000219
Chris Kay291e7182024-05-14 13:08:31 +0000220 # GNU Compiler Collection & GNU Binary Utilities
Chris Kay14260db2024-06-03 02:01:34 +0000221 toolchain-guess-tool-gnu-gcc = $(shell $(1) -v 2>&1 <$(nul) | grep -o "gcc version")
222 toolchain-guess-tool-gnu-ld = $(shell $(1) -v 2>&1 <$(nul) | grep -o "GNU ld")
223 toolchain-guess-tool-gnu-objcopy = $(shell $(1) --version 2>&1 <$(nul) | grep -o "GNU objcopy")
224 toolchain-guess-tool-gnu-objdump = $(shell $(1) --version 2>&1 <$(nul) | grep -o "GNU objdump")
225 toolchain-guess-tool-gnu-ar = $(shell $(1) --version 2>&1 <$(nul) | grep -o "GNU ar")
Chris Kaycc277de2023-10-20 09:17:33 +0000226
Chris Kay291e7182024-05-14 13:08:31 +0000227 # Other tools
Chris Kay14260db2024-06-03 02:01:34 +0000228 toolchain-guess-tool-generic-dtc = $(shell $(1) --version 2>&1 <$(nul) | grep -o "Version: DTC")
Chris Kaycc277de2023-10-20 09:17:33 +0000229
Chris Kay14260db2024-06-03 02:01:34 +0000230 toolchain-guess-tool = $(firstword $(foreach candidate,$(1), \
231 $(if $(call toolchain-guess-tool-$(candidate),$(2)),$(candidate))))
Chris Kay3d6c7e52024-04-16 17:19:20 +0000232
Chris Kay291e7182024-05-14 13:08:31 +0000233 #
234 # Locate and identify tools belonging to each toolchain.
235 #
236 # Each tool class in each toolchain receives a variable of the form
237 # `$(toolchain)-$(tool)` giving the associated path to the program. For
238 # example:
239 #
240 # - `aarch64-ld` gives the linker for the AArch64 toolchain,
241 # - `aarch32-oc` gives the object copier for the AArch32 toolchain, and
242 # - `host-cc` gives the C compiler for the host toolchain.
243 #
244 # For each of these variables, if no program path is explicitly provided
245 # by the parent Makefile then the C compiler is queried (if supported)
Chris Kay14260db2024-06-03 02:01:34 +0000246 # for its location.
Chris Kay291e7182024-05-14 13:08:31 +0000247 #
Chris Kay14260db2024-06-03 02:01:34 +0000248 # If the C compiler cannot provide the location (or the tool class *is*
249 # the C compiler), then it is assigned a default value specific for that
250 # toolchain.
Chris Kay291e7182024-05-14 13:08:31 +0000251 #
Chris Kay3d6c7e52024-04-16 17:19:20 +0000252
Chris Kay14260db2024-06-03 02:01:34 +0000253 toolchain-guess-arm-clang-cpp = $(1)
254 toolchain-guess-arm-clang-as = $(1)
255 toolchain-guess-arm-clang-ld = # Fall back to `$(toolchain)-ld-default`
256 toolchain-guess-arm-clang-oc = # Fall back to `$(toolchain)-oc-default`
257 toolchain-guess-arm-clang-od = # Fall back to `$(toolchain)-od-default`
258 toolchain-guess-arm-clang-ar = # Fall back to `$(toolchain)-ar-default`
Chris Kay3d6c7e52024-04-16 17:19:20 +0000259
Chris Kay14260db2024-06-03 02:01:34 +0000260 toolchain-guess-llvm-clang-cpp = $(1)
261 toolchain-guess-llvm-clang-as = $(1)
262 toolchain-guess-llvm-clang-ld = $(shell $(1) --print-prog-name ld.lld 2>$(nul))
263 toolchain-guess-llvm-clang-oc = $(shell $(1) --print-prog-name llvm-objcopy 2>$(nul))
264 toolchain-guess-llvm-clang-od = $(shell $(1) --print-prog-name llvm-objdump 2>$(nul))
265 toolchain-guess-llvm-clang-ar = $(shell $(1) --print-prog-name llvm-ar 2>$(nul))
Chris Kay3d6c7e52024-04-16 17:19:20 +0000266
Chris Kay14260db2024-06-03 02:01:34 +0000267 toolchain-guess-gnu-gcc-cpp = $(1)
268 toolchain-guess-gnu-gcc-as = $(1)
269 toolchain-guess-gnu-gcc-ld = $(1)
270 toolchain-guess-gnu-gcc-oc = $(shell $(1) --print-prog-name objcopy 2>$(nul))
271 toolchain-guess-gnu-gcc-od = $(shell $(1) --print-prog-name objdump 2>$(nul))
272 toolchain-guess-gnu-gcc-ar = $(shell $(1) --print-prog-name ar 2>$(nul))
Chris Kaycc277de2023-10-20 09:17:33 +0000273
Chris Kaye01c7122024-05-15 11:19:17 +0000274 define toolchain-warn-unrecognized
Chris Kay291e7182024-05-14 13:08:31 +0000275 $$(warning )
Chris Kay14260db2024-06-03 02:01:34 +0000276 $$(warning The configured $$($(1)-name) $$(toolchain-tool-class-name-$(2)) could not be identified and may not be supported:)
Chris Kay291e7182024-05-14 13:08:31 +0000277 $$(warning )
Chris Kaye01c7122024-05-15 11:19:17 +0000278 $$(warning $$(space) $$($(1)-$(2)))
Chris Kay291e7182024-05-14 13:08:31 +0000279 $$(warning )
Chris Kay14260db2024-06-03 02:01:34 +0000280 $$(warning The default $$($(1)-name) $$(toolchain-tool-class-name-$(2)) is:)
Chris Kay291e7182024-05-14 13:08:31 +0000281 $$(warning )
Chris Kaye01c7122024-05-15 11:19:17 +0000282 $$(warning $$(space) $$($(1)-$(2)-default))
Chris Kay291e7182024-05-14 13:08:31 +0000283 $$(warning )
284 $$(warning The following tools are supported:)
285 $$(warning )
Chris Kay3d6c7e52024-04-16 17:19:20 +0000286
Chris Kay14260db2024-06-03 02:01:34 +0000287 $$(foreach tool,$$(toolchain-tools-$(2)), \
288 $$(warning $$(space) - $$(toolchain-tool-name-$$(tool))))
Chris Kay3d6c7e52024-04-16 17:19:20 +0000289
Chris Kay291e7182024-05-14 13:08:31 +0000290 $$(warning )
Chris Kay14260db2024-06-03 02:01:34 +0000291 $$(warning The build system will treat this $$(toolchain-tool-class-name-$(2)) as $$(toolchain-tool-name-$$($(1)-$(2)-id-default)).)
Chris Kay291e7182024-05-14 13:08:31 +0000292 $$(warning )
293 endef
Chris Kaycc277de2023-10-20 09:17:33 +0000294
Chris Kaye01c7122024-05-15 11:19:17 +0000295 define toolchain-determine-tool
296 $(1)-$(2)-guess = $$(if $$(filter-out cc,$(2)),$\
Chris Kay14260db2024-06-03 02:01:34 +0000297 $$(call toolchain-guess-$$($(1)-cc-id)-$(2),$$($(1)-cc)))
Chris Kaycc277de2023-10-20 09:17:33 +0000298
Chris Kaye01c7122024-05-15 11:19:17 +0000299 $(1)-$(2) := $$(or $$($(1)-$(2)),$$($(1)-$(2)-guess))
300 $(1)-$(2) := $$(or $$($(1)-$(2)),$$($(1)-$(2)-default))
Chris Kay291e7182024-05-14 13:08:31 +0000301
Chris Kaye01c7122024-05-15 11:19:17 +0000302 ifneq ($$(call which,$$($(1)-$(2))),)
303 # If we can resolve this tool to a program on the `PATH`
304 # then escape it for use in a shell, which allows us to
Chris Kay14260db2024-06-03 02:01:34 +0000305 # preserve spaces.
Chris Kay291e7182024-05-14 13:08:31 +0000306
Chris Kaye01c7122024-05-15 11:19:17 +0000307 $(1)-$(2) := $$(call escape-shell,$$($(1)-$(2)))
Chris Kay291e7182024-05-14 13:08:31 +0000308 endif
309
Chris Kay14260db2024-06-03 02:01:34 +0000310 $(1)-$(2)-id := $$(call toolchain-guess-tool,$$(toolchain-tools-$(2)),$$($(1)-$(2)))
Chris Kaye01c7122024-05-15 11:19:17 +0000311
312 ifndef $(1)-$(2)-id
313 $(1)-$(2)-id := $$($(1)-$(2)-id-default)
314
315 $$(eval $$(call toolchain-warn-unrecognized,$(1),$(2)))
316 endif
Chris Kay291e7182024-05-14 13:08:31 +0000317 endef
318
Chris Kaye01c7122024-05-15 11:19:17 +0000319 define toolchain-determine
Chris Kay14260db2024-06-03 02:01:34 +0000320 $$(foreach tool-class,$$(toolchain-tool-classes), \
Chris Kaye01c7122024-05-15 11:19:17 +0000321 $$(eval $$(call toolchain-determine-tool,$(1),$$(tool-class))))
Chris Kay291e7182024-05-14 13:08:31 +0000322 endef
Chris Kaycc277de2023-10-20 09:17:33 +0000323
Chris Kay291e7182024-05-14 13:08:31 +0000324 $(foreach toolchain,$(toolchains), \
Chris Kaye01c7122024-05-15 11:19:17 +0000325 $(eval $(call toolchain-determine,$(toolchain))))
Chris Kay291e7182024-05-14 13:08:31 +0000326endif