autotools:强制 make 不重建 configure/Makefile [英] autotools: force make not to rebuild configure/Makefile

查看:27
本文介绍了autotools:强制 make 不重建 configure/Makefile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 autotools 的项目:automake、autoconf.

I have a project with autotools: automake, autoconf.

我想禁止make重新制作文件configureMakefile.in等;只是为了做编译工作.

I want to prohibit make from remaking files configure, Makefile.in, etc; just to do compile job.

有些文件是手工编辑的,我知道我不应该这样做.(或者项目是从 CVS 更新的,所有生成的文件都存储在 CVS 中).但目前我没有安装正确版本的自动工具.

Some of files are edited by hand, and I know that I should not to do this. (Or the project was updated from CVS with all generated files stored in CVS). But at the moment I have no correct version autotools installed.

这个文件的修改时间(必须是新的/旧的):

What must be modification times of this files (which must be newer/older):

aclocal.m4
configure.in
confdb/ax_prefix_config_h.m4
Makefile.am
Makefile.in
Makefile
configure
config.status

或者:我必须执行哪些 touch 命令序列才能实现我的目标?

Or: what sequence of touch commands must I do to achieve my goal?

推荐答案

首先,如果你直接编辑一个生成的文件,它无论如何都不会被重建,因为它比它的先决条件要新.

First of all, if you edit a generated file directly, it wouldn't be rebuilt anyway, because it is then newer then its prerequisites.

然后,这里有两件独立的事情:config.statusMakefile 在构建期间创建.除非您更新它们的时间戳,否则很难防止它们在构建过程中被重新制作.

Then, there are two separate things going on here: config.status and Makefile are created during the build. It's hard to prevent these from being remade during the build unless you make their timestamps newer.

其他文件由各种自动工具生成.默认情况下,Automake 的最新版本不会创建自动重新创建规则的规则.根据您的软件包,您可能希望使用 configure 选项 --disable-maintainer-mode.Automake 文档包含有关该选项的一些更有趣的信息.

The other files are generated by the various autotools. Recent versions of Automake do not create rules by default that remake them automatically. Depending on your package, you might want to use the configure option --disable-maintainer-mode. The Automake documentation contains some more interesting information about that option.

有时我对一个我不太了解或构建系统非常混乱的包使用的一个技巧是运行类似的东西

One trick I sometimes use with a package that I don't know much about or that has a pretty messed up build system is to run something like

make all AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=:

这样,如果这些程序碰巧被调用,noop 将被替换.

so that if these programs happen to be called, a noop would be substituted.

这篇关于autotools:强制 make 不重建 configure/Makefile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆