2018-06-09 15:37:55 +08:00
|
|
|
# usage: check_dep_exec <executable name> <variable>
|
|
|
|
#
|
|
|
|
# Create a target that checks the existence of the specified executable, and
|
|
|
|
# append that target to the given variable.
|
2018-05-29 23:34:33 +08:00
|
|
|
define check_dep_exec =
|
2018-06-09 15:37:55 +08:00
|
|
|
$(2) += check_exec_$(1)
|
|
|
|
check_exec_$(1):
|
2018-05-29 23:34:33 +08:00
|
|
|
@if ! which $(1) > /dev/null; then \
|
|
|
|
echo "******** Missing prerequisite tool ********"; \
|
|
|
|
echo "Cannot find executable *$(1)*"; \
|
|
|
|
echo "Please refer to the Getting Started Guide" \
|
|
|
|
"for installation instructions"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
2018-06-09 15:39:28 +08:00
|
|
|
# usage: check_dep_py3lib <library name> <variable>
|
2018-06-09 15:37:55 +08:00
|
|
|
#
|
2018-06-09 15:39:28 +08:00
|
|
|
# Create a target that checks the existence of the specified python 3 library, and
|
|
|
|
# append that target to the given variable.
|
|
|
|
define check_dep_py3lib =
|
|
|
|
$(2) += check_py3lib_$(1)
|
|
|
|
check_py3lib_$(1):
|
|
|
|
@if ! pip3 list 2>/dev/null | grep $(1) > /dev/null 2>&1; then \
|
2018-05-29 23:34:33 +08:00
|
|
|
echo "******** Missing prerequisite tool ********"; \
|
2018-06-09 15:39:28 +08:00
|
|
|
echo "The python3 library *$(1)* is not installed"; \
|
2018-05-29 23:34:33 +08:00
|
|
|
echo "Please refer to the Getting Started Guide" \
|
|
|
|
"for installation instructions"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
endef
|