makefile - Makefile 应该在 'make clean' 上删除自己吗?

标签 makefile posix configure

我有一个 configure编写 Makefile 的脚本(来自 Makefile.in)。 clean target 当前删除从 makefile 中创建的所有内容,但它不会删除 makefile 本身。 (正如您可能知道的那样,我没有使用 Autotools)

因此,我的问题是:makefile 是否也应自行删除,要求开发人员运行 ./configure再次?

一方面,我希望干净的目标能够正确地清理源树。但是,另一方面,我希望能够输入 make clean test在提交之前检查一切是否正常;不知何故,再次运行配置脚本似乎很奇怪。

最佳答案

这是一个文体问题,而不是一个技术问题。寻找答案的最佳地点是 automake manual ,它会告诉你:

`make clean'
     Erase from the build tree the files built by `make all'.

`make distclean'
     Additionally erase anything `./configure' created.

所以,不,make clean不应删除 Makefile . make distclean应该删除 Makefile , 因为它是由 configure 创建的不是 make all .

autotools 最好的事情之一是它们是一致的和标准的。最好不要通过无视这些标准来激怒您的用户。

关于makefile - Makefile 应该在 'make clean' 上删除自己吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18002951/

相关文章:

php - 在 OS X 上编译 PHP --with-php-config

c++ - 与 C++ 一起使用的 Lear Gist Descriptor C 代码

c - 在符合 POSIX 的 C 程序中确定二进制常规文件大小的最佳实践

git - 如何管道git clone

c - 与子信号和父信号同步将接收到的信号与文件进行匹配

linux - osm2pgsql 未找到 Protobuf : Centos

python - 如何从单独的类配置Tkinter小部件?

ubuntu - Makefile:72: *** 多个目标模式。停止。尝试在 ubuntu 14.04 上安装 imapsync 时

c++ - Makefile 问题 - 部分执行两次

c - C语言生成文件