bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Relax file existence test on 'include'd BUILT_SOURCES files?


From: Simon Josefsson
Subject: Relax file existence test on 'include'd BUILT_SOURCES files?
Date: Sat, 01 Nov 2003 04:08:36 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

(This is a fairly obscure feature request, with a trivial workaround.
Just in case you have more important matters to attend to...)

Makefile.am contains:

include $(srcdir)/Makefile.gdoci

and Makefile.gdoci contains:

BUILT_SOURCES = Makefile.gdoc
Makefile.gdoc: $(top_builddir)/configure Makefile.am Makefile.gdoci $(GDOC_SRC)
        echo '# This file is automatically generated.  DO NOT EDIT!          
-*- makefile -*-' > Makefile.gdoc
        ...
include Makefile.gdoc

The intention is to generate an automake makefile fragment,
Makefile.gdoc, based on source code files (source codes which may be
created during 'make'), that generate a man page or texinfo fragment
for each documented function in each source code file.  The generated
file dependencies should be updated automatically when the source
files changes, without causing all texi/man to be rebuilt.

This appear to work just fine, except that during bootstrapping from
CVS, when there is no Makefile.gdoc, automake complains that there is
no Makefile.gdoc:

automake: cannot open < doc/Makefile.gdoc: No such file or directory
autoreconf: automake failed with exit status: 1

Would it be possible to relax the file existence check for 'include'd
automake Makefile fragments, when those fragments are BUILT_SOURCES?
Instead just skip the 'include' statement, with the assurance that the
Makefile fragment will be built when 'make' is invoked, causing
Makefile.am to be rebuilt, which then will be able to properly
'include' the fragment, which then would create Makefile.in and
Makefile and then re-start (all of those steps already work!).

The relevant paragraph from the manual:

   Makefile fragments included this way are always distributed because
   there are needed to rebuild `Makefile.in'.

Doesn't seem to hold completely in this case; Makefile.gdoc is built
automatically whenever it is needed.

It might be the case that what I'm trying to do can be achieved much
simpler, if so or if you have any other ideas, let me know.

The workaround is to add 'touch Makefile.gdoc' to 'autogen.sh',
although I don't particularly like that.  Is it possible to execute
arbitrary commands before autoreconf/automake start in a clean way
from configure.ac?  That could be a slightly better workaround.

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]