automake
[Top][All Lists]
Advanced

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

Variable substitution in source files


From: Bill Moseley
Subject: Variable substitution in source files
Date: Sat, 13 Sep 2003 06:04:43 -0700
User-agent: Mutt/1.5.4i

I have a number of files that need variable substitution, so I do this in 
a Makefile.am:

foo: foo.in
        @rm -f foo
        @sed \
                -e 's,@@perlmoduledir@@,$(libexecdir)/perl,' \
                -e 's,@@swishbindir@@,$(bindir),' \
                -e 's,@@perlbinary@@,$(PERL),' \
                        $(srcdir)/foo.in > foo

But I'm doing that in more and more Makefile.am files in my project 
tree -- and sometimes I need to do it to a file where there isn't a 
Makefile in that directory.

I'm feeling like I'm using the same bit of sed code in too many places.
Is there a better way to manage this?  I'd like to have the sed code 
(above) defined in one place and then maybe list all the files that need 
to be operated on.

Thanks,


-- 
Bill Moseley
address@hidden





reply via email to

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