From c32737033cf2b0ae9649a08273c07b739d368818 Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Mon, 13 Jan 2025 15:57:32 +0000 Subject: [PATCH] build: remove Windows compatibility layer For a couple of releases now we have officially withdrawn support for building TF-A on Windows using the native environment, relying instead on POSIX emulation layers like MSYS2, Mingw64, Cygwin or WSL. This change removes the remainder of the OS compatibility layer entirely, and migrates the build system over to explicitly relying on a POSIX environment. Change-Id: I8fb60d998162422e958009afd17eab826e3bc39b Signed-off-by: Chris Kay --- Makefile | 38 ++++------------- make_helpers/build_env.mk | 67 ------------------------------ make_helpers/common.mk | 4 +- make_helpers/cygwin.mk | 19 --------- make_helpers/msys.mk | 20 --------- make_helpers/toolchain.mk | 49 +++++++++++----------- make_helpers/unix.mk | 48 --------------------- make_helpers/utilities.mk | 16 ++++++- make_helpers/windows.mk | 67 ------------------------------ plat/arm/board/a5ds/platform.mk | 7 +--- plat/arm/board/fvp/platform.mk | 4 +- plat/nxp/soc-lx2160a/ddr_fip.mk | 5 ++- plat/st/common/common.mk | 3 +- tools/amlogic/Makefile | 6 +-- tools/cert_create/Makefile | 9 ++-- tools/encrypt_fw/Makefile | 9 ++-- tools/fiptool/Makefile | 7 ++-- tools/fiptool/Makefile.msvc | 37 ----------------- tools/nxp/create_pbl/Makefile | 10 ++--- tools/nxp/create_pbl/create_pbl.mk | 5 ++- tools/nxp/create_pbl/pbl_ch2.mk | 5 ++- tools/nxp/create_pbl/pbl_ch3.mk | 5 ++- tools/sptool/Makefile | 7 ++-- tools/stm32image/Makefile | 7 ++-- 24 files changed, 91 insertions(+), 363 deletions(-) delete mode 100644 make_helpers/build_env.mk delete mode 100644 make_helpers/cygwin.mk delete mode 100644 make_helpers/msys.mk delete mode 100644 make_helpers/unix.mk delete mode 100644 make_helpers/windows.mk delete mode 100644 tools/fiptool/Makefile.msvc diff --git a/Makefile b/Makefile index a286a4a3b3..b8e9e12d2a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2013-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -23,7 +23,6 @@ MAKEOVERRIDES = MAKE_HELPERS_DIRECTORY := make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}build-rules.mk include ${MAKE_HELPERS_DIRECTORY}common.mk @@ -99,15 +98,15 @@ endif # Variables for use with Certificate Generation Tool CRTTOOLPATH ?= tools/cert_create -CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT} +CRTTOOL ?= ${CRTTOOLPATH}/cert_create$(.exe) # Variables for use with Firmware Encryption Tool ENCTOOLPATH ?= tools/encrypt_fw -ENCTOOL ?= ${ENCTOOLPATH}/encrypt_fw${BIN_EXT} +ENCTOOL ?= ${ENCTOOLPATH}/encrypt_fw$(.exe) # Variables for use with Firmware Image Package FIPTOOLPATH ?= tools/fiptool -FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT} +FIPTOOL ?= ${FIPTOOLPATH}/fiptool$(.exe) # Variables for use with sptool SPTOOLPATH ?= tools/sptool @@ -1646,29 +1645,17 @@ endif #(CHECKPATCH) clean: $(s)echo " CLEAN" - $(call SHELL_REMOVE_DIR,${BUILD_PLAT}) -ifdef UNIX_MK + $(q)rm -rf $(BUILD_PLAT) $(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean -else -# Clear the MAKEFLAGS as we do not want -# to pass the gnumake flags to nmake. - $(q)set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) clean -endif #(UNIX_MK) $(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean $(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} clean $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean realclean distclean: $(s)echo " REALCLEAN" - $(call SHELL_REMOVE_DIR,${BUILD_BASE}) - $(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*) -ifdef UNIX_MK + $(q)rm -rf $(BUILD_BASE) + $(q)rm -rf $(CURDIR)/cscope.* $(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean -else -# Clear the MAKEFLAGS as we do not want -# to pass the gnumake flags to nmake. - $(q)set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) realclean -endif #(UNIX_MK) $(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} realclean $(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} realclean $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean @@ -1753,25 +1740,14 @@ fip: ${BUILD_PLAT}/${FIP_NAME} fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} ${FIPTOOL}: FORCE -ifdef UNIX_MK $(q)${MAKE} PLAT=${PLAT} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${FIPTOOLPATH} all -else -# Clear the MAKEFLAGS as we do not want -# to pass the gnumake flags to nmake. - $(q)set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) -endif #(UNIX_MK) $(BUILD_PLAT)/romlib/romlib.bin $(BUILD_PLAT)/lib/libwrappers.a $&: $(BUILD_PLAT)/lib/libfdt.a $(BUILD_PLAT)/lib/libc.a $(CRYPTO_LIB) $(q)${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} CRYPTO_SUPPORT=${CRYPTO_SUPPORT} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES=$(call escape-shell,$(INCLUDES)) DEFINES=$(call escape-shell,$(DEFINES)) --no-print-directory -C ${ROMLIBPATH} all memmap: all -ifdef UNIX_MK $(q)PYTHONPATH=${CURDIR}/tools/memory \ ${PYTHON} -m memory.memmap -sr ${BUILD_PLAT} -else - $(q)set PYTHONPATH=${CURDIR}/tools/memory && \ - ${PYTHON} -m memory.memmap -sr ${BUILD_PLAT} -endif tl: ${BUILD_PLAT}/tl.bin ${BUILD_PLAT}/tl.bin: ${HW_CONFIG} diff --git a/make_helpers/build_env.mk b/make_helpers/build_env.mk deleted file mode 100644 index 13acaae4a7..0000000000 --- a/make_helpers/build_env.mk +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# This file contains the logic to identify and include any relevant -# build environment specific make include files. - -ifndef BUILD_ENV_MK - BUILD_ENV_MK := $(lastword $(MAKEFILE_LIST)) - - # Block possible built-in command definitions that are not fully portable. - # This traps occurences that need replacing with our OS portable macros - COPY := $$(error "Replace COPY with call to SHELL_COPY or SHELL_COPY_TREE.") - CP := $$(error "Replace CP with call to SHELL_COPY or SHELL_COPY_TREE.") - DEL := $$(error "Replace DEL with call to SHELL_DELETE.") - RD := $$(error "Replace RD with call to SHELL_REMOVE_DIR.") - RM := $$(error "Replace RM with call to SHELL_DELETE.") - RMDIR := $$(error "Replace RMDIR with call to SHELL_REMOVE_DIR.") - - ENV_FILE_TO_INCLUDE := unix.mk - ifdef OSTYPE - ifneq ($(findstring ${OSTYPE}, cygwin),) - ENV_FILE_TO_INCLUDE := cygwin.mk - else - ifneq ($(findstring ${OSTYPE}, MINGW32 mingw msys),) - ENV_FILE_TO_INCLUDE := msys.mk - endif - endif - else - ifdef MSYSTEM - # Although the MINGW MSYS shell sets OSTYPE as msys in its environment, - # it does not appear in the GNU make view of environment variables. - # We use MSYSTEM as an alternative, as that is seen by make - ifneq ($(findstring ${MSYSTEM}, MINGW32 mingw msys),) - OSTYPE ?= msys - ENV_FILE_TO_INCLUDE := msys.mk - endif - else - ifdef OS - ifneq ($(findstring ${OS}, Windows_NT),) - ENV_FILE_TO_INCLUDE := windows.mk - endif - endif - endif - endif - include $(dir $(lastword $(MAKEFILE_LIST)))${ENV_FILE_TO_INCLUDE} - ENV_FILE_TO_INCLUDE := - - ifndef SHELL_COPY - $(error "SHELL_COPY not defined for build environment.") - endif - ifndef SHELL_COPY_TREE - $(error "SHELL_COPY_TREE not defined for build environment.") - endif - ifndef SHELL_DELETE_ALL - $(error "SHELL_DELETE_ALL not defined for build environment.") - endif - ifndef SHELL_DELETE - $(error "SHELL_DELETE not defined for build environment.") - endif - ifndef SHELL_REMOVE_DIR - $(error "SHELL_REMOVE_DIR not defined for build environment.") - endif - -endif diff --git a/make_helpers/common.mk b/make_helpers/common.mk index 848e4e944b..a4b69c74bd 100644 --- a/make_helpers/common.mk +++ b/make_helpers/common.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -14,4 +14,6 @@ ifndef common-mk s := @$(if $(or $(verbose),$(silent)),: ) q := $(if $(verbose),,@) + + .exe := $(if $(filter Windows_NT,$(OS)),.exe) endif diff --git a/make_helpers/cygwin.mk b/make_helpers/cygwin.mk deleted file mode 100644 index 04a963ff37..0000000000 --- a/make_helpers/cygwin.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# -# - -# OS specific definitions for builds in a Cygwin environment. -# Cygwin allows us to use unix style commands on a windows platform. - -ifndef CYGWIN_MK - CYGWIN_MK := $(lastword $(MAKEFILE_LIST)) - - include ${MAKE_HELPERS_DIRECTORY}unix.mk - - # In cygwin executable files have the Windows .exe extension type. - BIN_EXT := .exe - -endif diff --git a/make_helpers/msys.mk b/make_helpers/msys.mk deleted file mode 100644 index 7e60d57f6c..0000000000 --- a/make_helpers/msys.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# -# - -# OS specific definitions for builds in a Mingw32 MSYS environment. -# Mingw32 allows us to use some unix style commands on a windows platform. - -ifndef MSYS_MK - MSYS_MK := $(lastword $(MAKEFILE_LIST)) - - include ${MAKE_HELPERS_DIRECTORY}unix.mk - - # In MSYS executable files have the Windows .exe extension type. - BIN_EXT := .exe - -endif - diff --git a/make_helpers/toolchain.mk b/make_helpers/toolchain.mk index 2ab577cd10..3b9d984e78 100644 --- a/make_helpers/toolchain.mk +++ b/make_helpers/toolchain.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2023-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -18,7 +18,6 @@ ifndef toolchain-mk toolchain-mk := $(lastword $(MAKEFILE_LIST)) - include $(dir $(toolchain-mk))build_env.mk include $(dir $(toolchain-mk))utilities.mk # @@ -242,28 +241,28 @@ ifndef toolchain-mk # # Arm Compiler for Embedded - toolchain-guess-tool-arm-clang = $(shell $(1) --version 2>&1 <$(nul) | grep -o "Tool: armclang") - toolchain-guess-tool-arm-link = $(shell $(1) --help 2>&1 <$(nul) | grep -o "Tool: armlink") - toolchain-guess-tool-arm-fromelf = $(shell $(1) --help 2>&1 <$(nul) | grep -o "Tool: fromelf") - toolchain-guess-tool-arm-ar = $(shell $(1) --version 2>&1 <$(nul) | grep -o "Tool: armar") + toolchain-guess-tool-arm-clang = $(shell $(1) --version 2>&1 &1 &1 &1 &1 <$(nul) | grep -o "clang version") - toolchain-guess-tool-llvm-lld = $(shell $(1) --help 2>&1 <$(nul) | grep -o "OVERVIEW: lld") - toolchain-guess-tool-llvm-objcopy = $(shell $(1) --help 2>&1 <$(nul) | grep -o "llvm-objcopy tool") - toolchain-guess-tool-llvm-objdump = $(shell $(1) --help 2>&1 <$(nul) | grep -o "llvm object file dumper") - toolchain-guess-tool-llvm-ar = $(shell $(1) --help 2>&1 <$(nul) | grep -o "LLVM Archiver") + toolchain-guess-tool-llvm-clang = $(shell $(1) -v 2>&1 &1 &1 &1 &1 &1 <$(nul) | grep -o "gcc version") - toolchain-guess-tool-gnu-ld = $(shell $(1) -v 2>&1 <$(nul) | grep -o "GNU ld") - toolchain-guess-tool-gnu-objcopy = $(shell $(1) --version 2>&1 <$(nul) | grep -o "GNU objcopy") - toolchain-guess-tool-gnu-objdump = $(shell $(1) --version 2>&1 <$(nul) | grep -o "GNU objdump") - toolchain-guess-tool-gnu-ar = $(shell $(1) --version 2>&1 <$(nul) | grep -o "GNU ar") + toolchain-guess-tool-gnu-gcc = $(shell $(1) -v 2>&1 &1 &1 &1 &1 &1 <$(nul) | grep -o "Version: DTC") - toolchain-guess-tool-generic-poetry = $(shell $(1) --version 2>&1 <$(nul)) + toolchain-guess-tool-generic-dtc = $(shell $(1) --version 2>&1 &1 $(nul)) - toolchain-derive-llvm-clang-oc = $(shell $(1) --print-prog-name llvm-objcopy 2>$(nul)) - toolchain-derive-llvm-clang-od = $(shell $(1) --print-prog-name llvm-objdump 2>$(nul)) - toolchain-derive-llvm-clang-ar = $(shell $(1) --print-prog-name llvm-ar 2>$(nul)) + toolchain-derive-llvm-clang-ld = $(shell $(1) --print-prog-name ld.lld 2>/dev/null) + toolchain-derive-llvm-clang-oc = $(shell $(1) --print-prog-name llvm-objcopy 2>/dev/null) + toolchain-derive-llvm-clang-od = $(shell $(1) --print-prog-name llvm-objdump 2>/dev/null) + toolchain-derive-llvm-clang-ar = $(shell $(1) --print-prog-name llvm-ar 2>/dev/null) toolchain-derive-gnu-gcc-cpp = $(1) toolchain-derive-gnu-gcc-as = $(1) toolchain-derive-gnu-gcc-ld = $(1) - toolchain-derive-gnu-gcc-oc = $(shell $(1) --print-prog-name objcopy 2>$(nul)) - toolchain-derive-gnu-gcc-od = $(shell $(1) --print-prog-name objdump 2>$(nul)) - toolchain-derive-gnu-gcc-ar = $(shell $(1) --print-prog-name ar 2>$(nul)) + toolchain-derive-gnu-gcc-oc = $(shell $(1) --print-prog-name objcopy 2>/dev/null) + toolchain-derive-gnu-gcc-od = $(shell $(1) --print-prog-name objdump 2>/dev/null) + toolchain-derive-gnu-gcc-ar = $(shell $(1) --print-prog-name ar 2>/dev/null) toolchain-derive = $(if $3,$(call toolchain-derive-$1-$2,$3)) diff --git a/make_helpers/unix.mk b/make_helpers/unix.mk deleted file mode 100644 index fa7722a6c6..0000000000 --- a/make_helpers/unix.mk +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# Trusted Firmware shell command definitions for a Unix style environment. - -ifndef UNIX_MK - UNIX_MK := $(lastword $(MAKEFILE_LIST)) - - DIR_DELIM := / - PATH_SEP := : - - # These defines provide Unix style equivalents of the shell commands - # required by the Trusted Firmware build environment. - - # ${1} is the file to be copied. - # ${2} is the destination file name. - define SHELL_COPY - $(q)cp -f "${1}" "${2}" - endef - - # ${1} is the directory to be copied. - # ${2} is the destination directory path. - define SHELL_COPY_TREE - $(q)cp -rf "${1}" "${2}" - endef - - # ${1} is the file to be deleted. - define SHELL_DELETE - -$(q)rm -f "${1}" - endef - - # ${1} is a space delimited list of files to be deleted. - # Note that we do not quote ${1}, as multiple parameters may be passed. - define SHELL_DELETE_ALL - -$(q)rm -rf ${1} - endef - - define SHELL_REMOVE_DIR - -$(q)rm -rf "${1}" - endef - - nul := /dev/null - - which = $(shell command -v $(call escape-shell,$(1)) 2>$(nul)) -endif diff --git a/make_helpers/utilities.mk b/make_helpers/utilities.mk index fcccd24060..10645bfb4e 100644 --- a/make_helpers/utilities.mk +++ b/make_helpers/utilities.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -127,3 +127,17 @@ bool-01 = $(if $(call bool,$(1)),1,0) # defined = $(call bool,$(filter-out undefined,$(origin $(1)))) + +# +# Determine the path to a program. +# +# Parameters: +# +# - $(1): The program to search for. +# +# Example usage: +# +# path-to-gcc := $(call which,gcc) # "/usr/bin/gcc" +# + +which = $(shell command -v $(call escape-shell,$(1)) 2>/dev/null) diff --git a/make_helpers/windows.mk b/make_helpers/windows.mk deleted file mode 100644 index c24aa08431..0000000000 --- a/make_helpers/windows.mk +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# OS specific parts for builds in a Windows_NT environment. The -# environment variable OS is set to Windows_NT on all modern Windows platforms - -# Include generic windows command definitions. - -ifndef WINDOWS_MK - WINDOWS_MK := $(lastword $(MAKEFILE_LIST)) - - DIR_DELIM := $(strip \) - BIN_EXT := .exe - PATH_SEP := ; - - # For some Windows native commands there is a problem with the directory delimiter. - # Make uses / (slash) and the commands expect \ (backslash) - # We have to provide a means of translating these, so we define local functions. - - # ${1} is the file to be copied. - # ${2} is the destination file name. - define SHELL_COPY - $(eval tmp_from_file:=$(subst /,\,${1})) - $(eval tmp_to_file:=$(subst /,\,${2})) - copy "${tmp_from_file}" "${tmp_to_file}" - endef - - # ${1} is the directory to be copied. - # ${2} is the destination directory path. - define SHELL_COPY_TREE - $(eval tmp_from_dir:=$(subst /,\,${1})) - $(eval tmp_to_dir:=$(subst /,\,${2})) - xcopy /HIVE "${tmp_from_dir}" "${tmp_to_dir}" - endef - - # ${1} is the file to be deleted. - define SHELL_DELETE - $(eval tmp_del_file:=$(subst /,\,${*})) - -@if exist $(tmp_del_file) del /Q $(tmp_del_file) - endef - - # ${1} is a space delimited list of files to be deleted. - define SHELL_DELETE_ALL - $(eval $(foreach filename,$(wildcard ${1}),$(call DELETE_IF_THERE,${filename}))) - endef - - # ${1} is the directory to be removed. - define SHELL_REMOVE_DIR - $(eval tmp_dir:=$(subst /,\,${1})) - -@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 -# the BUILD_STRING generation which uses git. -# For now we use "development build". -# This can be overridden from the command line or environment. -BUILD_STRING ?= development build - -MSVC_NMAKE := nmake.exe diff --git a/plat/arm/board/a5ds/platform.mk b/plat/arm/board/a5ds/platform.mk index dd82a10352..6d60cbe7ae 100644 --- a/plat/arm/board/a5ds/platform.mk +++ b/plat/arm/board/a5ds/platform.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023, Arm Limited. All rights reserved. +# Copyright (c) 2019-2025, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -75,9 +75,7 @@ BL2_SOURCES += lib/aarch32/arm32_aeabi_divmod.c \ ${DYN_CFG_SOURCES} \ ${A5DS_SECURITY_SOURCES} -# Add the FDT_SOURCES and options for Dynamic Config (only for Unix env) -ifdef UNIX_MK - +# Add the FDT_SOURCES and options for Dynamic Config FW_CONFIG := ${BUILD_PLAT}/fdts/a5ds_fw_config.dtb TB_FW_CONFIG := ${BUILD_PLAT}/fdts/a5ds_tb_fw_config.dtb @@ -94,7 +92,6 @@ $(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config,${FVP_HW_CONFIG})) FDT_SOURCES += plat/arm/board/a5ds/fdts/a5ds_fw_config.dts \ plat/arm/board/a5ds/fdts/a5ds_tb_fw_config.dts \ ${FVP_HW_CONFIG_DTS} -endif NEED_BL32 := yes diff --git a/plat/arm/board/fvp/platform.mk b/plat/arm/board/fvp/platform.mk index 08fbfeef2c..715af66064 100644 --- a/plat/arm/board/fvp/platform.mk +++ b/plat/arm/board/fvp/platform.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2013-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -338,7 +338,6 @@ BL31_SOURCES += drivers/delay_timer/generic_delay_timer.c endif # Add the FDT_SOURCES and options for Dynamic Config (only for Unix env) -ifdef UNIX_MK FVP_HW_CONFIG_DTS := fdts/${FVP_DT_PREFIX}.dts FDT_SOURCES += ${FVP_HW_CONFIG_DTS} @@ -390,7 +389,6 @@ endif # Add the HW_CONFIG to FIP and specify the same to certtool $(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config,${FVP_HW_CONFIG})) -endif ifeq (${TRANSFER_LIST}, 1) include lib/transfer_list/transfer_list.mk diff --git a/plat/nxp/soc-lx2160a/ddr_fip.mk b/plat/nxp/soc-lx2160a/ddr_fip.mk index c303cedb03..c1f14dc142 100644 --- a/plat/nxp/soc-lx2160a/ddr_fip.mk +++ b/plat/nxp/soc-lx2160a/ddr_fip.mk @@ -1,5 +1,6 @@ # # Copyright 2020 NXP +# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -67,7 +68,7 @@ include plat/nxp/soc-lx2160a/ddr_tbbr.mk # Variables for use with Certificate Generation Tool CRTTOOLPATH ?= tools/cert_create -CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT} +CRTTOOL ?= ${CRTTOOLPATH}/cert_create$(.exe) ifneq (${GENERATE_COT},0) ddr_certificates: ${DDR_CRT_DEPS} ${CRTTOOL} @@ -82,7 +83,7 @@ endif # Variables for use with Firmware Image Package FIPTOOLPATH ?= tools/fiptool -FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT} +FIPTOOL ?= ${FIPTOOLPATH}/fiptool$(.exe) ${BUILD_PLAT}/${DDR_FIP_NAME}: ${DDR_FIP_DEPS} ${FIPTOOL} $(eval ${CHECK_DDR_FIP_CMD}) diff --git a/plat/st/common/common.mk b/plat/st/common/common.mk index 7395a36785..dc753a0a16 100644 --- a/plat/st/common/common.mk +++ b/plat/st/common/common.mk @@ -1,5 +1,6 @@ # # Copyright (c) 2023-2024, STMicroelectronics - All Rights Reserved +# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -76,7 +77,7 @@ ASFLAGS += -DBL2_BIN_PATH=\"${BUILD_PLAT}/bl2.bin\" # Variables for use with stm32image STM32IMAGEPATH ?= tools/stm32image -STM32IMAGE ?= ${STM32IMAGEPATH}/stm32image${BIN_EXT} +STM32IMAGE ?= ${STM32IMAGEPATH}/stm32image$(.exe) STM32IMAGE_SRC := ${STM32IMAGEPATH}/stm32image.c STM32_DEPS += ${STM32IMAGE} diff --git a/tools/amlogic/Makefile b/tools/amlogic/Makefile index 7bfee7d7c3..cdaf7e711f 100644 --- a/tools/amlogic/Makefile +++ b/tools/amlogic/Makefile @@ -1,5 +1,6 @@ # # Copyright (C) 2019 Remi Pommarel +# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # https://spdx.org/licenses @@ -7,11 +8,10 @@ MAKE_HELPERS_DIRECTORY := ../../make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}common.mk include ${MAKE_HELPERS_DIRECTORY}toolchain.mk -PROJECT := doimage${BIN_EXT} +PROJECT := doimage$(.exe) OBJECTS := doimage.o HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99 -D_GNU_SOURCE @@ -38,6 +38,6 @@ ${PROJECT}: ${OBJECTS} Makefile $(q)$(host-cc) -c ${HOSTCCFLAGS} $< -o $@ clean: - $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS}) + $(q)rm -rf $(PROJECT) $(OBJECTS) distclean: clean diff --git a/tools/cert_create/Makefile b/tools/cert_create/Makefile index ce12a66058..e403b2d209 100644 --- a/tools/cert_create/Makefile +++ b/tools/cert_create/Makefile @@ -1,18 +1,17 @@ # -# Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2015-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # PLAT := none DEBUG := 0 -CRTTOOL ?= cert_create${BIN_EXT} +CRTTOOL ?= cert_create$(.exe) BINARY := $(notdir ${CRTTOOL}) COT := tbbr MAKE_HELPERS_DIRECTORY := ../../make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}common.mk include ${MAKE_HELPERS_DIRECTORY}defaults.mk include ${MAKE_HELPERS_DIRECTORY}toolchain.mk @@ -95,7 +94,7 @@ ifeq ($(DEBUG),1) endif clean: - $(call SHELL_DELETE_ALL,${OBJECTS}) + $(q)rm -rf $(OBJECTS) realclean: clean - $(call SHELL_DELETE,${BINARY}) + $(q)rm -f $(BINARY) diff --git a/tools/encrypt_fw/Makefile b/tools/encrypt_fw/Makefile index 50b0fa2f91..14def1d390 100644 --- a/tools/encrypt_fw/Makefile +++ b/tools/encrypt_fw/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2024, Arm Limited. All rights reserved. +# Copyright (c) 2024-2025, Arm Limited. All rights reserved. # Copyright (c) 2019-2022, Linaro Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause @@ -7,13 +7,12 @@ BUILD_INFO ?= 1 DEBUG := 0 -ENCTOOL ?= encrypt_fw${BIN_EXT} +ENCTOOL ?= encrypt_fw$(.exe) BINARY := $(notdir ${ENCTOOL}) OPENSSL_DIR := /usr MAKE_HELPERS_DIRECTORY := ../../make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}common.mk include ${MAKE_HELPERS_DIRECTORY}defaults.mk include ${MAKE_HELPERS_DIRECTORY}toolchain.mk @@ -75,7 +74,7 @@ ifeq ($(DEBUG),1) endif clean: - $(call SHELL_DELETE_ALL,${OBJECTS}) + $(q)rm -rf $(OBJECTS) realclean: clean - $(call SHELL_DELETE,${BINARY}) + $(q)rm -f $(BINARY) diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile index 54dee87e18..a660a500e4 100644 --- a/tools/fiptool/Makefile +++ b/tools/fiptool/Makefile @@ -1,17 +1,16 @@ # -# Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2014-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # MAKE_HELPERS_DIRECTORY := ../../make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}common.mk include ${MAKE_HELPERS_DIRECTORY}defaults.mk include ${MAKE_HELPERS_DIRECTORY}toolchain.mk -FIPTOOL ?= fiptool${BIN_EXT} +FIPTOOL ?= fiptool$(.exe) PROJECT := $(notdir ${FIPTOOL}) OBJECTS := fiptool.o tbbr_config.o STATIC ?= 0 @@ -93,4 +92,4 @@ endif endif # STATIC clean: - $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS} $(DEPS)) + $(q)rm -rf $(PROJECT) $(OBJECTS) $(DEPS) diff --git a/tools/fiptool/Makefile.msvc b/tools/fiptool/Makefile.msvc deleted file mode 100644 index 9081bc64c6..0000000000 --- a/tools/fiptool/Makefile.msvc +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (c) 2019-2020, Arm Limited. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -CC = cl.exe -LD = link.exe - -# FIPTOOLPATH and FIPTOOL are passed from the main makefile. - -OBJECTS = $(FIPTOOLPATH)\fiptool.obj \ - $(FIPTOOLPATH)\tbbr_config.obj \ - $(FIPTOOLPATH)\win_posix.obj - -INC = -I$(FIPTOOLPATH) -Iinclude\tools_share - -CFLAGS = $(CFLAGS) /nologo /Za /Zi /c /O2 /MT - -all: $(FIPTOOL) - -$(FIPTOOL): $(OBJECTS) - $(LD) /nologo /INCREMENTAL:NO /debug /nodefaultlib:libc.lib /out:$@ $(LIBS) $** - -.PHONY: clean realclean - -clean: - -@del /f /q $(OBJECTS) > nul - -@del /f /q $(FIPTOOLPATH)\*.pdb > nul - -realclean: - -@del /f /q $(OBJECTS) > nul - -@del /f /q $(FIPTOOLPATH)\*.pdb > nul - -@del /f /q $(FIPTOOL) > nul - -.c.obj: - $(CC) -c $(CFLAGS) $(INC) $< -Fo$@ diff --git a/tools/nxp/create_pbl/Makefile b/tools/nxp/create_pbl/Makefile index 22aa921d01..965cc510ac 100644 --- a/tools/nxp/create_pbl/Makefile +++ b/tools/nxp/create_pbl/Makefile @@ -1,18 +1,18 @@ # # Copyright 2018-2020 NXP +# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # MAKE_HELPERS_DIRECTORY := ../../../make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}common.mk include ${MAKE_HELPERS_DIRECTORY}toolchain.mk -PROJECT_1 := create_pbl${BIN_EXT} +PROJECT_1 := create_pbl$(.exe) OBJECTS_1 := create_pbl.o -PROJECT_2 := byte_swap${BIN_EXT} +PROJECT_2 := byte_swap$(.exe) OBJECTS_2 := byte_swap.o override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700 @@ -49,5 +49,5 @@ ${PROJECT_2}: ${OBJECTS_2} Makefile $(q)$(host-cc) -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@ clean: - $(call SHELL_DELETE_ALL, ${PROJECT_1} ${OBJECTS_1}) - $(call SHELL_DELETE_ALL, ${PROJECT_2} ${OBJECTS_2}) + $(q)rm -rf $(PROJECT_1) $(OBJECTS_1) + $(q)rm -rf $(PROJECT_2) $(OBJECTS_2) diff --git a/tools/nxp/create_pbl/create_pbl.mk b/tools/nxp/create_pbl/create_pbl.mk index 305c049d91..81f6d13aaf 100644 --- a/tools/nxp/create_pbl/create_pbl.mk +++ b/tools/nxp/create_pbl/create_pbl.mk @@ -1,12 +1,13 @@ # # Copyright 2018-2020 NXP +# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # # -CREATE_PBL ?= ${CREATE_PBL_TOOL_PATH}/create_pbl${BIN_EXT} -BYTE_SWAP ?= ${CREATE_PBL_TOOL_PATH}/byte_swap${BIN_EXT} +CREATE_PBL ?= ${CREATE_PBL_TOOL_PATH}/create_pbl$(.exe) +BYTE_SWAP ?= ${CREATE_PBL_TOOL_PATH}/byte_swap$(.exe) HOST_GCC := gcc diff --git a/tools/nxp/create_pbl/pbl_ch2.mk b/tools/nxp/create_pbl/pbl_ch2.mk index bf05a12d94..47ff8922c9 100644 --- a/tools/nxp/create_pbl/pbl_ch2.mk +++ b/tools/nxp/create_pbl/pbl_ch2.mk @@ -1,12 +1,13 @@ # # Copyright 2020 NXP +# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # # -CREATE_PBL ?= ${CREATE_PBL_TOOL_PATH}/create_pbl${BIN_EXT} -BYTE_SWAP ?= ${CREATE_PBL_TOOL_PATH}/byte_swap${BIN_EXT} +CREATE_PBL ?= ${CREATE_PBL_TOOL_PATH}/create_pbl$(.exe) +BYTE_SWAP ?= ${CREATE_PBL_TOOL_PATH}/byte_swap$(.exe) HOST_GCC := gcc diff --git a/tools/nxp/create_pbl/pbl_ch3.mk b/tools/nxp/create_pbl/pbl_ch3.mk index 15129e40cd..f5d42cdbef 100644 --- a/tools/nxp/create_pbl/pbl_ch3.mk +++ b/tools/nxp/create_pbl/pbl_ch3.mk @@ -1,13 +1,14 @@ # # Copyright 2018-2022 NXP +# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # # SHELL=/bin/bash -CREATE_PBL ?= ${CREATE_PBL_TOOL_PATH}/create_pbl${BIN_EXT} -BYTE_SWAP ?= ${CREATE_PBL_TOOL_PATH}/byte_swap${BIN_EXT} +CREATE_PBL ?= ${CREATE_PBL_TOOL_PATH}/create_pbl$(.exe) +BYTE_SWAP ?= ${CREATE_PBL_TOOL_PATH}/byte_swap$(.exe) HOST_GCC := gcc diff --git a/tools/sptool/Makefile b/tools/sptool/Makefile index 0da5c09c3e..f579a42ebf 100644 --- a/tools/sptool/Makefile +++ b/tools/sptool/Makefile @@ -1,16 +1,15 @@ # -# Copyright (c) 2018-2024, Arm Limited. All rights reserved. +# Copyright (c) 2018-2025, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # MAKE_HELPERS_DIRECTORY := ../../make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}common.mk include ${MAKE_HELPERS_DIRECTORY}toolchain.mk -SPTOOL ?= sptool${BIN_EXT} +SPTOOL ?= sptool$(.exe) PROJECT := $(notdir ${SPTOOL}) OBJECTS := sptool.o @@ -40,4 +39,4 @@ ${PROJECT}: ${OBJECTS} Makefile $(q)$(host-cc) -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@ clean: - $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS}) + $(q)rm -rf $(PROJECT) $(OBJECTS) diff --git a/tools/stm32image/Makefile b/tools/stm32image/Makefile index 453daaebaa..64b6ccfab4 100644 --- a/tools/stm32image/Makefile +++ b/tools/stm32image/Makefile @@ -1,16 +1,15 @@ # -# Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2017-2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # MAKE_HELPERS_DIRECTORY := ../../make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk -include ${MAKE_HELPERS_DIRECTORY}build_env.mk include ${MAKE_HELPERS_DIRECTORY}common.mk include ${MAKE_HELPERS_DIRECTORY}toolchain.mk -PROJECT := stm32image${BIN_EXT} +PROJECT := stm32image$(.exe) OBJECTS := stm32image.o HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99 -D_GNU_SOURCE @@ -37,6 +36,6 @@ ${PROJECT}: ${OBJECTS} Makefile $(q)$(host-cc) -c ${HOSTCCFLAGS} $< -o $@ clean: - $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS}) + $(q)rm -rf $(PROJECT) $(OBJECTS) distclean: clean