makefile - makefile中 "all-before"和 "all-after"的含义

标签 makefile

    .PHONY: all all-before all-after clean clean-custom

    all: all-before ../Flock.exe all-after

既然它在.PHONY中,它一定是一个Makefile关键字,但我不知道它是什么意思,甚至不知道它的作用。

最佳答案

它们不是关键字,它们指的是名为 all-beforeall-after 的规则,以便前者在构建可执行文件之前调用,后者在构建可执行文件之前调用之后立即调用。它们在 .PHONY 中被提及,因为它们不是文件名。

坏例子:

all: all-before binary all-after

binary:
  gcc input.c -o binary

all-before:
  -mkdir bin

all-after:
  -cp binary bin

关于makefile - makefile中 "all-before"和 "all-after"的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12012942/

相关文章:

c++ - gcc soname 无法识别的命令行

linux - Makefile 只创建第一个文件

linux - binutils 为 readelf 报错

java - jpcap 编译/安装在 Gumstix 上失败

c - 给定静态库列表和搜索目录(GCC/ld 格式),如何将它们组装成静态库

debugging - 如何暂停以检查 Makefile 运行的 sh 命令的结果?

c - 库的 Makefile

makefile - 如何在 qmake 生成的 Makefile 中添加自定义目标?

bash - 为什么我要做 Cmake .. 并制作?

cmake 和 make 构建重现性