[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to correctly generate 'foobar.h' from 'foobar.h.in'
From: |
Gary V. Vaughan |
Subject: |
Re: How to correctly generate 'foobar.h' from 'foobar.h.in' |
Date: |
Sat, 7 Aug 2010 10:49:40 +0700 |
On Aug 7, 2010, at 10:31 AM, Mike Frysinger <address@hidden> wrote:
> On Friday, August 06, 2010 20:19:41 Tao Wang wrote:
>> Thank you. It works for my C/C++ files.
>> However, how it works on text file and script file? They don't have
>> compiler to pass the define from parameters. For most scripts, they don't
>> accept bash syntax "${prefix}", they do need the value of
>> "${prefix}/share". How can I do that?
>
> typically people dont expand things in such files
Or you can add a rule to Makefile.am (or Makefile if you're not using Automake)
that performs the substitution with a shell snippet that calls sed - that way
${prefix} is expanded by the shell before passing it to sed.
Have a look at how GNU M4 creates its bootstrap script for an example.
Cheers,
--
Gary V. Vaughan (address@hidden)