1# 2# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7# Trusted Firmware shell command definitions for a Unix style environment. 8 9ifndef UNIX_MK 10 UNIX_MK := $(lastword $(MAKEFILE_LIST)) 11 12 DIR_DELIM := / 13 PATH_SEP := : 14 15 # These defines provide Unix style equivalents of the shell commands 16 # required by the Trusted Firmware build environment. 17 18 # ${1} is the file to be copied. 19 # ${2} is the destination file name. 20 define SHELL_COPY 21 $(q)cp -f "${1}" "${2}" 22 endef 23 24 # ${1} is the directory to be copied. 25 # ${2} is the destination directory path. 26 define SHELL_COPY_TREE 27 $(q)cp -rf "${1}" "${2}" 28 endef 29 30 # ${1} is the file to be deleted. 31 define SHELL_DELETE 32 -$(q)rm -f "${1}" 33 endef 34 35 # ${1} is a space delimited list of files to be deleted. 36 # Note that we do not quote ${1}, as multiple parameters may be passed. 37 define SHELL_DELETE_ALL 38 -$(q)rm -rf ${1} 39 endef 40 41 define SHELL_REMOVE_DIR 42 -$(q)rm -rf "${1}" 43 endef 44 45 nul := /dev/null 46 47 which = $(shell command -v $(call escape-shell,$(1)) 2>$(nul)) 48endif 49