Evan Lloyd | f1477d4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 1 | # |
Evan Lloyd | 6ba7d27 | 2017-04-07 16:58:57 +0100 | [diff] [blame] | 2 | # Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. |
Evan Lloyd | f1477d4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 3 | # |
dp-arm | 82cb2c1 | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Evan Lloyd | f1477d4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 5 | # |
| 6 | # |
| 7 | |
| 8 | # Trusted Firmware shell command definitions for a Unix style environment. |
| 9 | |
| 10 | ifndef UNIX_MK |
| 11 | UNIX_MK := $(lastword $(MAKEFILE_LIST)) |
| 12 | |
| 13 | ECHO_BLANK_LINE := echo |
| 14 | |
| 15 | DIR_DELIM := / |
| 16 | PATH_SEP := : |
| 17 | |
| 18 | # These defines provide Unix style equivalents of the shell commands |
| 19 | # required by the Trusted Firmware build environment. |
| 20 | |
| 21 | # ${1} is the file to be copied. |
| 22 | # ${2} is the destination file name. |
| 23 | define SHELL_COPY |
| 24 | ${Q}cp -f "${1}" "${2}" |
| 25 | endef |
| 26 | |
| 27 | # ${1} is the directory to be copied. |
| 28 | # ${2} is the destination directory path. |
| 29 | define SHELL_COPY_TREE |
| 30 | ${Q}cp -rf "${1}" "${2}" |
| 31 | endef |
| 32 | |
| 33 | # ${1} is the file to be deleted. |
| 34 | define SHELL_DELETE |
| 35 | -${Q}rm -f "${1}" |
| 36 | endef |
| 37 | |
| 38 | # ${1} is a space delimited list of files to be deleted. |
| 39 | # Note that we do not quote ${1}, as multiple parameters may be passed. |
| 40 | define SHELL_DELETE_ALL |
| 41 | -${Q}rm -rf ${1} |
| 42 | endef |
| 43 | |
| 44 | # ${1} is the directory to be generated. |
| 45 | # ${2} is optional, and allows a prerequisite to be specified. |
Evan Lloyd | 6ba7d27 | 2017-04-07 16:58:57 +0100 | [diff] [blame] | 46 | # Do nothing if $1 == $2, to ignore self dependencies. |
Evan Lloyd | f1477d4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 47 | define MAKE_PREREQ_DIR |
Evan Lloyd | 6ba7d27 | 2017-04-07 16:58:57 +0100 | [diff] [blame] | 48 | ifneq (${1},${2}) |
Evan Lloyd | f1477d4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 49 | |
| 50 | ${1} : ${2} |
| 51 | ${Q}mkdir -p "${1}" |
| 52 | |
Evan Lloyd | 6ba7d27 | 2017-04-07 16:58:57 +0100 | [diff] [blame] | 53 | endif |
Evan Lloyd | f1477d4 | 2015-12-02 18:33:55 +0000 | [diff] [blame] | 54 | endef |
| 55 | |
| 56 | define SHELL_REMOVE_DIR |
| 57 | -${Q}rm -rf "${1}" |
| 58 | endef |
| 59 | |
| 60 | endif |