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

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

问题描述

我有一个带有自动工具的项目: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.

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

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