automake
[Top][All Lists]
Advanced

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

Re: Include directive for all generated Makefile.in


From: Ralf Wildenhues
Subject: Re: Include directive for all generated Makefile.in
Date: Wed, 14 Apr 2010 07:53:17 +0200
User-agent: Mutt/1.5.20 (2009-10-28)

* Steffen Dettmer wrote on Tue, Apr 13, 2010 at 10:14:54PM CEST:
> On Tue, Apr 13, 2010 at 7:53 PM, Ralf Wildenhues <address@hidden> wrote:
> > * Xavier MARCELET wrote on Tue, Apr 13, 2010 at 09:38:36AM CEST:
> > For example, we could have a couple of macros
> >
> > # AM_MAKEFILE_PREPEND([FRAGMENT], [SUBDIR-PATTERN])
> > # -------------------------------------------------
> > # Prepend FRAGMENT file to all Makefile.am files matching SUBDIR-PATTERN.
> > # Multiple fragments are included in LIFO order.
> >
> > # AM_MAKEFILE_APPEND([FRAGMENT], [SUBDIR-PATTERN])
> > # ------------------------------------------------
> > # Append FRAGMENT file to all Makefile.am files matching SUBDIR-PATTERN.
> > # Multiple fragments are included in FIFO order.
> 
> would it be a potential possibility instead to `overwrite and
> specialize' some macro?

With "some macro", you mean "some prepended or appended makefile.am
snippet" here, right?

> If, for example, there would be some
> logic consisting of OUTPUT_HEADER OUTPUT_CONTENT OUTPUT_FOOTER
> could someone overwrite one of them to add some lines?
> I guess this probably could be more flexible (but no idea if this
> makes any sense in this context).

Well, my idea of the above would be that if you used
  AM_MAKEFILE_APPEND([bot1])
  AM_MAKEFILE_APPEND([bot2])
  AM_MAKEFILE_PREPEND([top2])
  AM_MAKEFILE_PREPEND([top1])

then that would amount to the same as if you had added this to your
Makefile.am:
  include $(top_srcdir)/top1
  include $(top_srcdir)/top2
  ... rest of Makefile.am contents ...
  include $(top_srcdir)/bot1
  include $(top_srcdir)/bot2

In that way, adding more lines would be easy.  However, overwriting
lines from 'top1' after that AM_MAKEFILE_PREPEND would not be easy.
In order to achieve something like that, we'd have to have a scheme to
identify included snippets by number or name, and maybe priority.

Do you have a good use case for this overwriting (that would justify
this complication)?

Thanks,
Ralf




reply via email to

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