mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 01:24:27 +00:00
Merge "build: refactor toolchain detection" into integration
This commit is contained in:
commit
084c9d3c0d
21 changed files with 458 additions and 7 deletions
6
Makefile
6
Makefile
|
@ -31,6 +31,12 @@ include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
|||
|
||||
include ${MAKE_HELPERS_DIRECTORY}defaults.mk
|
||||
|
||||
################################################################################
|
||||
# Configure the toolchains used to build TF-A and its tools
|
||||
################################################################################
|
||||
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
# Assertions enabled for DEBUG builds by default
|
||||
ENABLE_ASSERTIONS := ${DEBUG}
|
||||
ENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION}
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := aarch64
|
||||
|
||||
include ../../make_helpers/toolchain.mk
|
||||
|
||||
AS = $(CROSS_COMPILE)gcc
|
||||
AR = $(CROSS_COMPILE)gcc-ar
|
||||
LD = $(CROSS_COMPILE)ld
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
|
||||
# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
@ -47,7 +47,7 @@ ifndef BUILD_ENV_MK
|
|||
endif
|
||||
endif
|
||||
endif
|
||||
include ${MAKE_HELPERS_DIRECTORY}${ENV_FILE_TO_INCLUDE}
|
||||
include $(dir $(lastword $(MAKEFILE_LIST)))${ENV_FILE_TO_INCLUDE}
|
||||
ENV_FILE_TO_INCLUDE :=
|
||||
|
||||
ifndef SHELL_COPY
|
||||
|
|
343
make_helpers/toolchain.mk
Normal file
343
make_helpers/toolchain.mk
Normal file
|
@ -0,0 +1,343 @@
|
|||
#
|
||||
# Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
#
|
||||
# TF-A uses three toolchains:
|
||||
#
|
||||
# - The host toolchain (`host`) for building native tools
|
||||
# - The AArch32 toolchain (`aarch32`) for building Arm AArch32 images
|
||||
# - The AArch64 toolchain (`aarch64`) for building Arm AArch64 images
|
||||
#
|
||||
# In the main Makefile only one of the two Arm toolchains is enabled in any
|
||||
# given build, but individual tools and libraries may need access to both.
|
||||
#
|
||||
|
||||
toolchains ?= host $(ARCH)
|
||||
|
||||
ifneq ($(filter host,$(toolchains)),)
|
||||
host-cc := $(HOSTCC)
|
||||
host-cpp := $(HOSTCPP)
|
||||
|
||||
host-as := $(HOSTAS)
|
||||
|
||||
host-ld := $(HOSTLD)
|
||||
host-oc := $(HOSTOC)
|
||||
host-od := $(HOSTOD)
|
||||
host-ar := $(HOSTAR)
|
||||
|
||||
host-dtc := $(HOSTDTC)
|
||||
endif
|
||||
|
||||
ifneq ($(filter aarch32,$(toolchains)),)
|
||||
aarch32-cc := $(if $(filter-out default,$(origin CC)),$(CC))
|
||||
aarch32-cpp := $(if $(filter-out default,$(origin CPP)),$(CPP))
|
||||
|
||||
aarch32-as := $(if $(filter-out default,$(origin AS)),$(AS))
|
||||
|
||||
aarch32-ld := $(if $(filter-out default,$(origin LD)),$(LD))
|
||||
aarch32-oc := $(if $(filter-out default,$(origin OC)),$(OC))
|
||||
aarch32-od := $(if $(filter-out default,$(origin OD)),$(OD))
|
||||
aarch32-ar := $(if $(filter-out default,$(origin AR)),$(AR))
|
||||
|
||||
aarch32-dtc := $(if $(filter-out default,$(origin DTC)),$(DTC))
|
||||
endif
|
||||
|
||||
ifneq ($(filter aarch64,$(toolchains)),)
|
||||
aarch64-cc := $(if $(filter-out default,$(origin CC)),$(CC))
|
||||
aarch64-cpp := $(if $(filter-out default,$(origin CPP)),$(CPP))
|
||||
|
||||
aarch64-as := $(if $(filter-out default,$(origin AS)),$(AS))
|
||||
|
||||
aarch64-ld := $(if $(filter-out default,$(origin LD)),$(LD))
|
||||
aarch64-oc := $(if $(filter-out default,$(origin OC)),$(OC))
|
||||
aarch64-od := $(if $(filter-out default,$(origin OD)),$(OD))
|
||||
aarch64-ar := $(if $(filter-out default,$(origin AR)),$(AR))
|
||||
|
||||
aarch64-dtc := $(if $(filter-out default,$(origin DTC)),$(DTC))
|
||||
endif
|
||||
|
||||
include $(dir $(lastword $(MAKEFILE_LIST)))build_env.mk
|
||||
include $(addprefix $(dir $(lastword $(MAKEFILE_LIST)))toolchains/, \
|
||||
$(addsuffix .mk,$(toolchains)))
|
||||
|
||||
#
|
||||
# Configure tool classes that we recognize.
|
||||
#
|
||||
# In the context of this build system, a tool class identifies a specific role
|
||||
# or type of tool in the toolchain.
|
||||
#
|
||||
|
||||
# C-related tools
|
||||
tool-classes := cc # C compilers
|
||||
tool-classes += cpp # C preprocessors
|
||||
|
||||
# Assembly-related tools
|
||||
tool-classes += as # Assemblers
|
||||
|
||||
# Linking and object-handling tools
|
||||
tool-classes += ld # Linkers
|
||||
tool-classes += oc # Object copiers
|
||||
tool-classes += od # Object dumpers
|
||||
tool-classes += ar # Archivers
|
||||
|
||||
# Other tools
|
||||
tool-classes += dtc # Device tree compilers
|
||||
|
||||
#
|
||||
# Configure tools that we recognize.
|
||||
#
|
||||
# Here we declare the list of specific toolchain tools that we know how to
|
||||
# interact with. We don't organize these into tool classes yet - that happens
|
||||
# further down.
|
||||
#
|
||||
|
||||
# Arm Compiler for Embedded
|
||||
tools := arm-clang # armclang
|
||||
tools += arm-link # armlink
|
||||
tools += arm-ar # armar
|
||||
tools += arm-fromelf # fromelf
|
||||
|
||||
# LLVM Project
|
||||
tools += llvm-clang # clang
|
||||
tools += llvm-lld # lld
|
||||
tools += llvm-objcopy # llvm-objcopy
|
||||
tools += llvm-objdump # llvm-objdump
|
||||
tools += llvm-ar # llvm-ar
|
||||
|
||||
# GNU Compiler Collection & GNU Binary Utilities
|
||||
tools += gnu-gcc # gcc
|
||||
tools += gnu-ld # ld
|
||||
tools += gnu-objcopy # objcopy
|
||||
tools += gnu-objdump # objdump
|
||||
tools += gnu-ar # gcc-ar
|
||||
|
||||
# Other tools
|
||||
tools += dtc # Device Tree Compiler
|
||||
|
||||
#
|
||||
# Assign tools to tool classes.
|
||||
#
|
||||
# Multifunctional tools, i.e. tools which can perform multiple roles in a
|
||||
# toolchain, may be specified in multiple tool class lists. For example, a C
|
||||
# compiler which can also perform the role of a linker may be placed in both
|
||||
# `tools-cc` and `tools-ld`.
|
||||
#
|
||||
|
||||
# C-related tools
|
||||
tools-cc := arm-clang llvm-clang gnu-gcc # C compilers
|
||||
tools-cpp := arm-clang llvm-clang gnu-gcc # C preprocessors
|
||||
|
||||
# Assembly-related tools
|
||||
tools-as := arm-clang llvm-clang gnu-gcc # Assemblers
|
||||
|
||||
# Linking and object-handling tools
|
||||
tools-ld := arm-clang arm-link llvm-clang llvm-lld gnu-gcc gnu-ld # Linkers
|
||||
tools-oc := arm-fromelf llvm-objcopy gnu-objcopy # Object copiers
|
||||
tools-od := arm-fromelf llvm-objdump gnu-objdump # Object dumpers
|
||||
tools-ar := arm-ar llvm-ar gnu-ar # Archivers
|
||||
|
||||
# Other tools
|
||||
tools-dtc := dtc # Device tree compilers
|
||||
|
||||
define check-tool-class-tools
|
||||
$(eval tool-class := $(1))
|
||||
|
||||
ifndef tools-$(tool-class)
|
||||
$$(error no tools registered to handle tool class `$(tool-class)`)
|
||||
endif
|
||||
endef
|
||||
|
||||
$(foreach tool-class,$(tool-classes), \
|
||||
$(eval $(call check-tool-class-tools,$(tool-class))))
|
||||
|
||||
#
|
||||
# Default tools for each toolchain.
|
||||
#
|
||||
# Toolchains can specify a default path to any given tool with a tool class.
|
||||
# These values are used in the absence of user-specified values, and are
|
||||
# configured by the parent Makefile using variables of the form:
|
||||
#
|
||||
# - $(toolchain)-$(tool-class)-default
|
||||
#
|
||||
# For example, the default C compiler for the AArch32 and AArch64 toolchains
|
||||
# could be configured with:
|
||||
#
|
||||
# - aarch32-cc-default
|
||||
# - aarch64-cc-default
|
||||
#
|
||||
|
||||
define check-toolchain-tool-class-default
|
||||
$(eval toolchain := $(1))
|
||||
$(eval tool-class := $(2))
|
||||
|
||||
ifndef $(toolchain)-$(tool-class)-default
|
||||
$$(error no default value specified for tool class `$(tool-class)` of toolchain `$(toolchain)`)
|
||||
endif
|
||||
endef
|
||||
|
||||
define check-toolchain-tool-class-defaults
|
||||
$(eval toolchain := $(1))
|
||||
|
||||
$(foreach tool-class,$(tool-classes), \
|
||||
$(eval $(call check-toolchain-tool-class-default,$(toolchain),$(tool-class))))
|
||||
endef
|
||||
|
||||
$(foreach toolchain,$(toolchains), \
|
||||
$(eval $(call check-toolchain-tool-class-defaults,$(toolchain))))
|
||||
|
||||
#
|
||||
# Helper functions to identify toolchain tools.
|
||||
#
|
||||
# The functions defined in this section return a tool identifier when given a
|
||||
# path to a binary. We generally check a help or version string to more reliably
|
||||
# identify tools than by looking at the path alone (e.g. `gcc` on macOS is
|
||||
# actually Apple Clang).
|
||||
#
|
||||
# Each tool-guessing function (`guess-tool-$(tool)`) takes a single argument
|
||||
# giving the path to the tool to guess, and returns a non-empty value if the
|
||||
# tool corresponds to the tool identifier `$(tool)`:
|
||||
#
|
||||
# $(call guess-tool-llvm-clang,aarch64-none-elf-gcc) # <empty>
|
||||
# $(call guess-tool-gnu-gcc,aarch64-none-elf-gcc) # <non-empty>
|
||||
#
|
||||
# The `guess-tool` function tries to find the corresponding tool identifier
|
||||
# for a tool given its path. It takes two arguments:
|
||||
#
|
||||
# - $(1): a list of candidate tool identifiers to check
|
||||
# - $(2): the path to the tool to identify
|
||||
#
|
||||
# If any of the guess functions corresponding to candidate tool identifiers
|
||||
# return a non-empty value then the tool identifier of the first function to do
|
||||
# so is returned:
|
||||
#
|
||||
# $(call guess-tool,gnu-gcc llvm-clang,armclang) # <empty>
|
||||
# $(call guess-tool,gnu-gcc llvm-clang,clang-14) # llvm-clang
|
||||
# $(call guess-tool,gnu-gcc llvm-clang,aarch64-none-elf-gcc-12) # gnu-gcc
|
||||
#
|
||||
# Tools are checked in the order that they appear in `tools-$(tool-class)`, and
|
||||
# the first match is returned.
|
||||
#
|
||||
|
||||
# Arm Compiler for Embedded
|
||||
guess-tool-arm-clang = $(shell $(1) --version 2>&1 | grep -o "Tool: armclang")
|
||||
guess-tool-arm-link = $(shell $(1) --help 2>&1 | grep -o "Tool: armlink")
|
||||
guess-tool-arm-fromelf = $(shell $(1) --help 2>&1 | grep -o "Tool: fromelf")
|
||||
guess-tool-arm-ar = $(shell $(1) --version 2>&1 | grep -o "Tool: armar")
|
||||
|
||||
# LLVM Project
|
||||
guess-tool-llvm-clang = $(shell $(1) -v 2>&1 | grep -o "clang version")
|
||||
guess-tool-llvm-lld = $(shell $(1) --help 2>&1 | grep -o "OVERVIEW: lld")
|
||||
guess-tool-llvm-objcopy = $(shell $(1) --help 2>&1 | grep -o "llvm-objcopy tool")
|
||||
guess-tool-llvm-objdump = $(shell $(1) --help 2>&1 | grep -o "llvm object file dumper")
|
||||
guess-tool-llvm-ar = $(shell $(1) --help 2>&1 | grep -o "LLVM Archiver")
|
||||
|
||||
# GNU Compiler Collection & GNU Binary Utilities
|
||||
guess-tool-gnu-gcc = $(shell $(1) -v 2>&1 | grep -o "gcc version")
|
||||
guess-tool-gnu-ld = $(shell $(1) -v 2>&1 | grep -o "GNU ld")
|
||||
guess-tool-gnu-objcopy = $(shell $(1) --version 2>&1 | grep -o "GNU objcopy")
|
||||
guess-tool-gnu-objdump = $(shell $(1) --version 2>&1 | grep -o "GNU objdump")
|
||||
guess-tool-gnu-ar = $(shell $(1) --version 2>&1 | grep -o "GNU ar")
|
||||
|
||||
# Other tools
|
||||
guess-tool-dtc = $(shell $(1) --version 2>&1 | grep -o "Version: DTC")
|
||||
|
||||
guess-tool = $(firstword $(foreach candidate,$(1), \
|
||||
$(if $(call guess-tool-$(candidate),$(2)),$(candidate))))
|
||||
|
||||
#
|
||||
# Locate and identify tools belonging to each toolchain.
|
||||
#
|
||||
# Each tool class in each toolchain receives a variable of the form
|
||||
# `$(toolchain)-$(tool)` giving the associated path to the program. For example:
|
||||
#
|
||||
# - `aarch64-ld` gives the linker for the AArch64 toolchain,
|
||||
# - `aarch32-oc` gives the object copier for the AArch32 toolchain, and
|
||||
# - `host-cc` gives the C compiler for the host toolchain.
|
||||
#
|
||||
# For each of these variables, if no program path is explicitly provided by the
|
||||
# parent Makefile then the C compiler is queried (if supported) for its
|
||||
# location. This is done via the `guess-$(tool)-$(tool-class)` set of functions.
|
||||
# For example:
|
||||
#
|
||||
# - `guess-arm-clang-ld` guesses the linker via Arm Clang,
|
||||
# - `guess-llvm-clang-as` guesses the assembler via LLVM Clang, and
|
||||
# - `guess-gnu-gcc-od` guesses the object dumper via GNU GCC.
|
||||
#
|
||||
# If the C compiler cannot provide the location (or the tool class is the C
|
||||
# compiler), then it is assigned the value of the `$(toolchain)-$(tool)-default`
|
||||
# variable.
|
||||
#
|
||||
|
||||
guess-arm-clang-cpp = $(1) # Use the C compiler
|
||||
guess-arm-clang-as = $(1) # Use the C compiler
|
||||
guess-arm-clang-ld = # Fall back to `$(toolchain)-ld-default`
|
||||
guess-arm-clang-oc = # Fall back to `$(toolchain)-oc-default`
|
||||
guess-arm-clang-od = # Fall back to `$(toolchain)-od-default`
|
||||
guess-arm-clang-ar = # Fall back to `$(toolchain)-ar-default`
|
||||
|
||||
guess-llvm-clang-cpp = $(1) # Use the C compiler
|
||||
guess-llvm-clang-as = $(1) # Use the C compiler
|
||||
guess-llvm-clang-ld = $(shell $(1) --print-prog-name ld.lld 2>$(nul))
|
||||
guess-llvm-clang-oc = $(shell $(1) --print-prog-name llvm-objcopy 2>$(nul))
|
||||
guess-llvm-clang-od = $(shell $(1) --print-prog-name llvm-objdump 2>$(nul))
|
||||
guess-llvm-clang-ar = $(shell $(1) --print-prog-name llvm-ar 2>$(nul))
|
||||
|
||||
guess-gnu-gcc-cpp = $(1) # Use the C compiler
|
||||
guess-gnu-gcc-as = $(1) # Use the C compiler
|
||||
guess-gnu-gcc-ld = $(if $(filter 1,$(ENABLE_LTO)),$(1),$(shell $(1) --print-prog-name ld.bfd 2>$(nul)))
|
||||
guess-gnu-gcc-oc = $(shell $(1) --print-prog-name objcopy 2>$(nul))
|
||||
guess-gnu-gcc-od = $(shell $(1) --print-prog-name objdump 2>$(nul))
|
||||
guess-gnu-gcc-ar = $(patsubst %$(notdir $(1)),%$(subst gcc,gcc-ar,$(notdir $(1))),$(1))
|
||||
|
||||
define locate-toolchain-tool-cc
|
||||
$(eval toolchain := $(1))
|
||||
|
||||
$(toolchain)-cc := $$(strip \
|
||||
$$(or $$($(toolchain)-cc),$$($(toolchain)-cc-default)))
|
||||
$(toolchain)-cc-id := $$(strip \
|
||||
$$(call guess-tool,$$(tools-cc),$$($(toolchain)-cc)))
|
||||
endef
|
||||
|
||||
define locate-toolchain-tool
|
||||
$(eval toolchain := $(1))
|
||||
$(eval tool-class := $(2))
|
||||
|
||||
ifndef $(toolchain)-$(tool-class)
|
||||
$(toolchain)-$(tool-class) := $$(strip \
|
||||
$$(call guess-$$($(toolchain)-cc-id)-$(tool-class),$$($(toolchain)-cc)))
|
||||
|
||||
ifeq ($$($(toolchain)-$(tool-class)),)
|
||||
$(toolchain)-$(tool-class) := $$(strip \
|
||||
$$($(toolchain)-$(tool-class)-default))
|
||||
endif
|
||||
endif
|
||||
|
||||
$(toolchain)-$(tool-class)-id := $$(strip \
|
||||
$$(call guess-tool,$$(tools-$(tool-class)),$$($$(toolchain)-$(tool-class))))
|
||||
endef
|
||||
|
||||
define canonicalize-toolchain-tool-path
|
||||
$(eval toolchain := $(1))
|
||||
$(eval tool-class := $(2))
|
||||
|
||||
$(toolchain)-$(tool-class) := $$(strip $$(or \
|
||||
$$(call which,$$($(toolchain)-$(tool-class))), \
|
||||
$$($(toolchain)-$(tool-class))))
|
||||
endef
|
||||
|
||||
define locate-toolchain
|
||||
$(eval toolchain := $(1))
|
||||
|
||||
$$(eval $$(call locate-toolchain-tool-cc,$(toolchain)))
|
||||
$$(eval $$(call canonicalize-toolchain-tool-path,$(toolchain),cc))
|
||||
|
||||
$$(foreach tool-class,$$(filter-out cc,$$(tool-classes)), \
|
||||
$$(eval $$(call locate-toolchain-tool,$(toolchain),$$(tool-class))) \
|
||||
$$(eval $$(call canonicalize-toolchain-tool-path,$(toolchain),$$(tool-class))))
|
||||
endef
|
||||
|
||||
$(foreach toolchain,$(toolchains), \
|
||||
$(eval $(call locate-toolchain,$(toolchain))))
|
14
make_helpers/toolchains/aarch32.mk
Normal file
14
make_helpers/toolchains/aarch32.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
aarch32-cc-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc
|
||||
aarch32-cpp-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc
|
||||
aarch32-as-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc
|
||||
aarch32-ld-default := $(or $(CROSS_COMPILE),arm-none-eabi-)ld.bfd
|
||||
aarch32-oc-default := $(or $(CROSS_COMPILE),arm-none-eabi-)objcopy
|
||||
aarch32-od-default := $(or $(CROSS_COMPILE),arm-none-eabi-)objdump
|
||||
aarch32-ar-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc-ar
|
||||
aarch32-dtc-default := dtc
|
14
make_helpers/toolchains/aarch64.mk
Normal file
14
make_helpers/toolchains/aarch64.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
aarch64-cc-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc
|
||||
aarch64-cpp-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc
|
||||
aarch64-as-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc
|
||||
aarch64-ld-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)ld.bfd
|
||||
aarch64-oc-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)objcopy
|
||||
aarch64-od-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)objdump
|
||||
aarch64-ar-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc-ar
|
||||
aarch64-dtc-default := dtc
|
14
make_helpers/toolchains/host.mk
Normal file
14
make_helpers/toolchains/host.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
host-cc-default := gcc
|
||||
host-cpp-default := gcc
|
||||
host-as-default := gcc
|
||||
host-ld-default := gcc
|
||||
host-oc-default := objcopy
|
||||
host-od-default := objdump
|
||||
host-ar-default := gcc-ar
|
||||
host-dtc-default := dtc
|
14
make_helpers/toolchains/rk3399-m0.mk
Normal file
14
make_helpers/toolchains/rk3399-m0.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
rk3399-m0-cc-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc
|
||||
rk3399-m0-cpp-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc
|
||||
rk3399-m0-as-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc
|
||||
rk3399-m0-ld-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)ld.bfd
|
||||
rk3399-m0-oc-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)objcopy
|
||||
rk3399-m0-od-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)objdump
|
||||
rk3399-m0-ar-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc-ar
|
||||
rk3399-m0-dtc-default := dtc
|
|
@ -57,4 +57,7 @@ ${1} : ${2}
|
|||
-${Q}rm -rf "${1}"
|
||||
endef
|
||||
|
||||
nul := /dev/null
|
||||
|
||||
which = $(shell which $(1) 2>$(nul))
|
||||
endif
|
||||
|
|
|
@ -68,6 +68,9 @@ ${1} : ${2}
|
|||
-@if exist "$(tmp_dir)" rd /Q /S "$(tmp_dir)"
|
||||
endef
|
||||
|
||||
nul := nul
|
||||
|
||||
which = $(shell where $(1) 2>$(nul))
|
||||
endif
|
||||
|
||||
# Because git is not available from CMD.EXE, we need to avoid
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := rk3399-m0
|
||||
|
||||
include ../../../../../make_helpers/toolchain.mk
|
||||
|
||||
# Cross Compile
|
||||
M0_CROSS_COMPILE ?= arm-none-eabi-
|
||||
|
||||
|
|
|
@ -4,9 +4,13 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://spdx.org/licenses
|
||||
#
|
||||
|
||||
toolchains := host
|
||||
|
||||
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
PROJECT := doimage${BIN_EXT}
|
||||
OBJECTS := doimage.o
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2015-2022, Arm Limited and Contributors. All rights reserved.
|
||||
# Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
@ -11,10 +11,13 @@ CRTTOOL ?= cert_create${BIN_EXT}
|
|||
BINARY := $(notdir ${CRTTOOL})
|
||||
COT := tbbr
|
||||
|
||||
toolchains := host
|
||||
|
||||
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}defaults.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
ifneq (${PLAT},none)
|
||||
TF_PLATFORM_ROOT := ../../plat/
|
||||
|
@ -108,4 +111,3 @@ clean:
|
|||
|
||||
realclean: clean
|
||||
$(call SHELL_DELETE,${BINARY})
|
||||
|
||||
|
|
|
@ -11,11 +11,13 @@ ENCTOOL ?= encrypt_fw${BIN_EXT}
|
|||
BINARY := $(notdir ${ENCTOOL})
|
||||
OPENSSL_DIR := /usr
|
||||
|
||||
toolchains := host
|
||||
|
||||
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}defaults.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
OBJECTS := src/encrypt.o \
|
||||
src/cmd_opt.o \
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
#
|
||||
# Copyright (c) 2014-2023, Arm Limited and Contributors. All rights reserved.
|
||||
# Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := host
|
||||
|
||||
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}defaults.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
FIPTOOL ?= fiptool${BIN_EXT}
|
||||
PROJECT := $(notdir ${FIPTOOL})
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://spdx.org/licenses
|
||||
|
||||
toolchains := host
|
||||
|
||||
include ../../../make_helpers/toolchain.mk
|
||||
|
||||
PROJECT = doimage
|
||||
OBJECTS = doimage.o
|
||||
|
||||
|
|
|
@ -4,9 +4,12 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := host
|
||||
|
||||
MAKE_HELPERS_DIRECTORY := ../../../make_helpers/
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
PROJECT_1 := create_pbl${BIN_EXT}
|
||||
OBJECTS_1 := create_pbl.o
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := aarch64
|
||||
|
||||
include ../../../make_helpers/toolchain.mk
|
||||
|
||||
###################################################
|
||||
# makefile
|
||||
###################################################
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := aarch64
|
||||
|
||||
include ../../../make_helpers/toolchain.mk
|
||||
|
||||
###################################################
|
||||
# makefile
|
||||
###################################################
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
#
|
||||
# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
|
||||
# Copyright (c) 2018-2024, Arm Limited. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := host
|
||||
|
||||
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
SPTOOL ?= sptool${BIN_EXT}
|
||||
PROJECT := $(notdir ${SPTOOL})
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
#
|
||||
# Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
|
||||
# Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
toolchains := host
|
||||
|
||||
MAKE_HELPERS_DIRECTORY := ../../make_helpers/
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
|
||||
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||
|
||||
PROJECT := stm32image${BIN_EXT}
|
||||
OBJECTS := stm32image.o
|
||||
|
|
Loading…
Add table
Reference in a new issue