makefile的默认shell是/bin/sh,本身不支持source
可以将shell切换成/bin/csh来支持source
如下所示:
#Makefile
SHELL := /bin/csh
rule:
source env.sh && YourCommand
本文介绍如何在Makefile中通过切换Shell为/bin/csh来支持source命令,这对于需要在make过程中加载环境变量的场景非常有用。
makefile的默认shell是/bin/sh,本身不支持source
可以将shell切换成/bin/csh来支持source
如下所示:
#Makefile
SHELL := /bin/csh
rule:
source env.sh && YourCommand

被折叠的 条评论
为什么被折叠?
