summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mk/Scripts/depends-list.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/Mk/Scripts/depends-list.sh b/Mk/Scripts/depends-list.sh
index 7573d59719ad..d5cf1c67ec49 100644
--- a/Mk/Scripts/depends-list.sh
+++ b/Mk/Scripts/depends-list.sh
@@ -21,9 +21,12 @@ done
shift $((OPTIND-1))
validate_env dp_ALLDEPENDS dp_PORTSDIR dp_PKGNAME
-[ ${recursive} -eq 1 ] && validate_env dp_MAKE
-
-MAKE="${dp_MAKE}" PORTSDIR="${dp_PORTSDIR}" export_ports_env >/dev/null
+if [ ${recursive} -eq 1 ]; then
+ validate_env dp_MAKE
+ # Cache command executions to avoid looking them up again in every
+ # sub-make.
+ MAKE="${dp_MAKE}" PORTSDIR="${dp_PORTSDIR}" export_ports_env >/dev/null
+fi
set -u