bash - 如何从 Makefile 运行 bash 脚本?

标签 bash makefile

我有一个 Makefile,我想从中调用另一个外部 bash 脚本来完成构建的另一部分。我最好怎么做才能做到这一点?

最佳答案

就像从 makefile 调用任何其他命令一样:

target: prerequisites
    shell_script arg1 arg2 arg3

关于您的进一步解释:

.PHONY: do_script

do_script: 
    shell_script arg1 arg2 arg3

prerequisites: do_script

target: prerequisites 

关于bash - 如何从 Makefile 运行 bash 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2497675/

相关文章:

makefile - 收到错误 "recompile with -fPIC"

linux - 使并行作业性能

makefile - 试图覆盖 `/var/backups/infodir.bak' ,它也在包 x 中

linux - 如何为我的 shell 脚本制作手册页?

mysql - 在 bash 中查询制表符分隔文件的包

linux - cron 调度程序如何 cd 到某个位置并执行 shell 脚本

c - 如何使用openMP为MPI程序制作makefile?

c - Makefile 无法为简单项目创建单独的对象文件夹

python - 使用 Django 运行 bash 脚本

bash - 如何使用 sed 或 awk 打印第一行和段落的模式