Re: Template Makefile.ams and srcdir != builddir



Peter Williams <peter newton cx> writes:

> On 21 Jun 2001 23:21:49 -0400, Owen Taylor wrote:
> > I think the problem is actually:
> > 
> > ====
> >                  Prerequisite `gobject-decl.txt' does not exist.
> >                  Prerequisite `gobject.args' does not exist.
> >                  Prerequisite `gobject.hierarchy' does not exist.
> >                  Prerequisite `gobject.signals' does not exist.
> >                  Prerequisite `../../../../../cvs/glib/docs/reference/gobject/gobject-sections.txt' is older than target `tmpl-build.stamp'.
> >                  Prerequisite `../../../../../cvs/glib/docs/reference/gobject/gobject-overrides.txt' is older than target `tmpl-build.stamp'.
> >                 Must remake target `tmpl-build.stamp'.
> > *** Rebuilding template files ***
> > ===
> > 
> > Which may have something to do the earlier:
> > 
> > ===
> >  Must remake target `gobject.args'.
> >                     Ignoring VPATH name `../../../../../cvs/glib/docs/reference/gobject/gobject.args'.
> > ===
> > 
> > But I need to look into it more, since I don't quite understand
> > what this means.
> 
> Right. And I think the cause of "Ignoring VPATH name" is that it "must
> be remade".
> 
> >From the GNU make info page:
> 
> ==
> 	("the target" = a file found in VPATH)
> 
>        b. If the target *does* need to be rebuilt (is out-of-date), the
>           pathname found during directory search is *thrown away*, and
>           the target is rebuilt using the file name specified in the
>           makefile.  In short, if `make' must rebuild, then the target
>           is rebuilt locally, not in the directory found via directory
>           search.
> ==

Exactly. Just tracked this down myself.

> So 'make', seeing that the stampfile is "out of date" (although we know
> that it isn't) tries to create a local version. Which is impossible
> because the code that creates the stampfile cd's to $(srcdir).
> 
> Solution: make all the stampfiles in builddir, I guess. Is there a
> reason that certain stampfiles are made in srcdir, or is it only a side
> effect of the "cd $(srcdir)" at the beginning of the rules?

gtk.args isn't a stamp file. It is a generated file that just happens
to be empty for this module.

One possibility would be to add the concept of VPATH into gtkdoc, so
it was happy when it source files were in a different location than
the generated files.

Disadvantages being:

 * Damon's new setting-up procedure where it autogenerates
   some of the files that should be later checked in will
   leave these files in builddir, not sourcedir.

 * Would take some programming.  

It would get rid of the awful --output-dir hack in gtkdoc-scan[g]obj,
as one advantage.


A really simple solution, which works in testing, is to add to the
Makefile.am:

GPATH= srcdir@

Since this is described as emulating the behavior of "some other
makes" for VPATH, relying on this GNU extension may not hurt
portability.

(We could also require GNU make to --enable-gtk-doc; I don't
think people would cry much - it's a lot easier to have on
your system then a working SGML/docbook setup, and we
dist the html files for the final tarballs.)

Regards,
                                        Owen




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