传递变量时抛出"Command not found"
Make throws "Command not found" when passing a variable
我正在使用
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
在我的 Makefile 中
download:
aws s3 cp s3://$(PATH) .
并且在做 make PATH=<a valid location> download
它抛出错误
make[1]: aws: Command not found
调试时,我注意到只有在使用 $(PATH)
时才会发生这种情况。当s3路径不使用变量时,make命令起作用。
这是怎么回事,如何将变量传递给 make 命令?
PATH
是您的 shell 用来查找可执行文件的系统变量。如果重新定义它,aws
将无法再在 PATH
中找到。使用不同的变量名。
我正在使用
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
在我的 Makefile 中
download:
aws s3 cp s3://$(PATH) .
并且在做 make PATH=<a valid location> download
它抛出错误
make[1]: aws: Command not found
调试时,我注意到只有在使用 $(PATH)
时才会发生这种情况。当s3路径不使用变量时,make命令起作用。
这是怎么回事,如何将变量传递给 make 命令?
PATH
是您的 shell 用来查找可执行文件的系统变量。如果重新定义它,aws
将无法再在 PATH
中找到。使用不同的变量名。