Makefile: Do not export SHELL

The intent for exporting the SHELL variable is to ensure that all
Makefile target comands are run with the amended PATH value that is
set via the "export PATH := ..." directive.

However, exporting PATH value is all that is necessary to ensure that
all target commands run with the amended PATH.  It is not necessary to
*also* export a SHELL command that explicitly sets the PATH value.

Specifically: setting SHELL to use "env" to set the PATH environment
variable gets difficult if the PATH includes whitespace.  make's
assignment right hand side parsing does not treat quotes as delimiters
of tokens.  For example, the following directive in a Makefile results
in the FOO variable having 3 tokens, not 2:

FOO := bar "baz yow"

Therefore, achieving the overall goal of amending the PATH for all
Makefile target commands -- even if the PATH includes whitespace -- is
best achieved simply by not exporting the SHELL.

Signed-off-by: Ethan Dieterich <ethandieterich@gmail.com>
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
This commit is contained in:
Ethan Dieterich
2025-03-06 12:09:25 -05:00
committed by Jeff Squyres
parent a4449010a4
commit 246fa79967
-1
View File
@@ -1,5 +1,4 @@
export PATH := $(abspath bin/protoc/bin/):$(abspath bin/):${PATH}
export SHELL := env PATH=$(PATH) /bin/sh
OS = $(shell uname | tr A-Z a-z)