blob: 62769fb4122892d4736358ff5a8957871240a099 [file] [log] [blame]
Chris Kay2c09bf62024-04-09 16:30:52 +00001#
2# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7space :=
8space := $(space) $(space)
9comma := ,
10
11null :=
12
13compat-path = $(subst $(space),$(null),$(1))
14decompat-path = $(subst $(null), ,$(1))
15
16absolute-path = $(call decompat-path,$(abspath $(call compat-path,$(1))))
17real-path = $(call decompat-path,$(realpath $(call compat-path,$(1))))
18
19file-name = $(call decompat-path,$(notdir $(call compat-path,$(1))))
20directory-name = $(call decompat-path,$(dir $(call compat-path,$(1))))
21
22escape-shell = '$(subst ','\'',$(1))'