SHELL 변수로 설정되지 않으면 /bin/sh가 되므로
bash에서 지원하는 popd pushd 등이 봉인..
환경 변수 등을 끌어 가지 않으므로.. 결론은 Makefile 별로 설정을 해주어야 한다.
5.3.2 Choosing the Shell
The program used as the shell is taken from the variable SHELL
. If this variable is not set in your makefile, the program /bin/sh is used as the shell. The argument(s) passed to the shell are taken from the variable .SHELLFLAGS
. The default value of .SHELLFLAGS
is -c
normally, or -ec
in POSIX-conforming mode.
Unlike most variables, the variable SHELL
is never set from the environment. This is because the SHELL
environment variable is used to specify your personal choice of shell program for interactive use. It would be very bad for personal choices like this to affect the functioning of makefiles. See Variables from the Environment.
Furthermore, when you do set SHELL
in your makefile that value is not exported in the environment to recipe lines that make
invokes. Instead, the value inherited from the user’s environment, if any, is exported. You can override this behavior by explicitly exporting SHELL
(see Communicating Variables to a Sub-make
), forcing it to be passed in the environment to recipe lines.
[링크 : https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html]
[링크 : https://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html]