Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

autotools: force make not to rebuild configure/Makefile

I have a project with autotools: automake, autoconf.

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

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

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

like image 956
osgx Avatar asked Apr 20 '11 13:04

osgx


People also ask

What is Autogen sh?

The autogen.sh script generates the configure script (from configure.ac , using autoconf) and any files it needs (like creating Makefile.in from Makefile.am using automake).

What is Makefile am and Makefile in?

A Makefile.am has the same syntax as an ordinary Makefile . When automake processes a Makefile.am it copies the entire file into the output Makefile.in (that will be later turned into Makefile by configure ) but will react to certain variable definitions by generating some build rules and other variables.

What is Am_conditional?

Macro: AM_CONDITIONAL ( conditional , condition ) The conditional name, conditional , should be a simple string starting with a letter and containing only letters, digits, and underscores. It must be different from ' TRUE ' and ' FALSE ', which are reserved by Automake.

What is Am_init_automake?

AM_INIT_AUTOMAKE([OPTIONS]) Runs many macros required for proper operation of the generated Makefiles. Today, AM_INIT_AUTOMAKE is called with a single argument: a space-separated list of Automake options that should be applied to every Makefile.am in the tree.


1 Answers

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

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.

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=:

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

like image 132
Peter Eisentraut Avatar answered Oct 11 '22 05:10

Peter Eisentraut