Makefile: improve uninstall error handling
Introduce helper functions to handle uninstall errors gracefully. Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
15
tools/helpers.mk
Normal file
15
tools/helpers.mk
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright(c) 2021 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
#
|
||||
|
||||
define remove-file
|
||||
@if [ -f ${1} ] || [ -L ${1} ]; then rm -rf ${1}; \
|
||||
else echo "WARNING: Cannot find file ${1}"; fi
|
||||
endef
|
||||
|
||||
define remove-directory
|
||||
@if [ -d ${1} ]; then rm -rf ${1}; \
|
||||
else echo "WARNING: Cannot find directory ${1}"; fi
|
||||
endef
|
||||
|
||||
Reference in New Issue
Block a user