Hello Peter,

* Peter Breitenlohner wrote on Tue, Mar 17, 2009 at 07:24:16PM CET:
> A program is built conditionally from distributed and generated sources.
> Some of the distributed C files include generated headers and therefore can
> not be compiled before these headers are generated.

List these headers in BUILT_SOURCES; see
<http://www.gnu.org/software/automake/manual/html_node/Built-sources-example.html>

> A related problem: a tool generates a C file plus header from one source,
> and another C file plus header from another source. Each of these C files
> includes both headers, therefore the C files can not be compiled before both
> headers have been created.

For tools that produce multiple outputs, see
<http://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html>
Depending on the strategy you employ, you can list a witness or a stamp
file in BUILT_SOURCES I guess.

> What is the best way to teach this kind of dependencies to Automake,
> avoiding unnecessary tasks, not interfering with Automake's automatic
> dependency tracking,

I don't think any of the above would interfere with dependency tracking.
As to extra tasks, the multiple-outputs node suggestions do locking and
whatnot, but try hard to not run the actual tool more than needed.

> and not having 'make dist' gratuitously build files that are never
> used.

Well, do you distribute any files that depend on these built files?
If you stick to distributing all files which are prerequisites to
distributed files, then there should be no problem.

But showing an example failure is always the easiest to analyze.

Cheers,
Ralf


Reply via email to