bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: VPATH rebuilding of gawk


From: Andrew J. Schorr
Subject: Re: VPATH rebuilding of gawk
Date: Mon, 22 Jan 2007 15:57:20 -0500
User-agent: Mutt/1.4.2.1i

Hi Ralf,

On Mon, Jan 22, 2007 at 08:56:41PM +0100, Ralf Wildenhues wrote:
> Well.  If the `eg' directory is distributed in a tarball, there is no
> contradiction here: you unpack the tarball, build it.  `eg' should be
> up to date at this point, because all its prerequisites are up to date.
> So no changes should happen; you must however make sure that it does
> not depend upon any files which are created in the build tree.

Yes, well I guess I see no reason to include the 'eg' tree in the
distributed tarball (or in CVS for that matter).  Given that 'eg'
is generated from the .texi docs, why bother to distribute it and/or
maintain it?

> A note to the patch:
> 
> > -pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
> > -   $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
> > +pwcat$(EXEEXT): stamp-eg
> > +   $(COMPILE) `dirname $<`/eg/lib/pwcat.c $(LDFLAGS) -o $@
> 
> The `$<' macro is portable in inference rules (like .c.o) only.
> Solaris `make' will barf otherwise.  Several instances in the patch.

My mistake, thanks for catching that, you seem to be correct, even though
the Sun documentation seems to suggest that $< ought to work.  The man
page says:

        $<    The name of a dependency file, derived as if  selected
              for use with an implicit rule.

But in fact, it does not seem to work in this context, as you suspected.
I just tested on Solaris 8, and it seems that the automatic variable $^ will
work with both Solaris make and gnu make, so `dirname $<` should be replaced
with `dirname $^` in all 5 places in the patch.

> Didn't you in this case mean to write either `$(srcdir)' or `.' anyway?

I wrote it this way just to be extra safe: it should work regardless
of where the 'eg' tree resides (in the source directory or in the
build directory).  But if everybody can agree that 'eg' should be removed
from the distro tarball, then it could be replaced with '.'.  I don't
think using '$(srcdir)' could ever be safe, because you don't really
know whether the 'eg' tree will be: if it's up-to-date in the
source tree, then it will be under $(srcdir), but if out's out-of-date
and needs to be rebuilt, one would like it to be in the build directory,
I think.

> Further, are awklib/eg/lib/groupawk.in and awklib/eg/lib/passwdawk.in
> also generated files (I currently don't see how)?  If not you'd need to
> put them in EXTRA_DIST as well.

Yes, I do believe those files are generated from doc/gawk.texi.  The
Makefile is quite clear: the entire 'eg' tree is built from doc/gawk.texi and 
doc/gawkinet.texi by the awklib/extract.awk script.

   bash-3.00$ grep 'eg/lib/.*awk.in' doc/gawk.texi
   @c file eg/lib/passwdawk.in
   @c file eg/lib/passwdawk.in
   @c file eg/lib/passwdawk.in
   @c file eg/lib/passwdawk.in
   @c file eg/lib/passwdawk.in
   @c file eg/lib/passwdawk.in
   @c file eg/lib/passwdawk.in
   @c file eg/lib/groupawk.in
   @c file eg/lib/groupawk.in
   @c file eg/lib/groupawk.in
   @c file eg/lib/groupawk.in
   @c file eg/lib/groupawk.in
   @c file eg/lib/groupawk.in
   @c file eg/lib/groupawk.in
   @c file eg/lib/groupawk.in

Regards,
Andy




reply via email to

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