Russ Allbery wrote:
Daniel Pocock <[email protected]> writes:
Thanks for that - the sed example appears to be the type of thing I want.
However, is there a more concise way to do this? I was thinking there may
be some way to invoke sed or m4 on a template in much the way that gcc is
invoked for *.c
Half of that equation would be a more generic script. Attached is what we
use for INN (which has a bunch of INN-specific bits, but also has the
basic framework for things).
The script seems fine - I've located it in your source tree here
http://inn.eyrie.org/svn/trunk/support/
and examples of how you use it here:
http://inn.eyrie.org/svn/trunk/scripts/
The other half would be to set up a way of automatically running that
script on particular files, and that's something I've never done. I just
write explicit rules.
This is what interests me - although I could list out the rules for each
target, I would like to try and do everything with automake
This is how I've been going about it: create $(top_srcdir)/ganglia.inc
like so:
FIXCONFIG = $(top)/scripts/fixconfig
%: %.tmpl $(FIXCONFIG)
$(FIXCONFIG) $<
and put something like the following into each Makefile.am:
include $(top_srcdir)/ganglia.inc
bin_SCRIPTS = ganglia-config
However, things like ganglia-config should be generated during the
install phase, although the default behavior for the _SCRIPTS primary
appears to be processing ganglia-config.in during the build phase - is
there a recommended way it can be influenced to delay processing until
the install phase?