makefike调用shell脚本
时间: 2023-11-28 17:46:29 浏览: 406
可以通过Makefile来调用shell脚本,具体方法如下所示:
假设有一个名为test.sh的shell脚本,内容如下:
#!/bin/bash
echo "Hello World!"
现在我们需要在Makefile中调用该脚本,可以按照以下步骤进行:
1.在Makefile中定义一个目标,例如:
hello:
2.在该目标下添加命令,调用shell脚本,例如:
hello:
sh test.sh
3.在终端中进入Makefile所在的目录,执行make命令,即可调用shell脚本,例如:
make hello
执行结果为:
Hello World!
相关推荐
















