This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: making pre-build headers
- To: Paul Martinolich <martinol at datasync dot com>
- Subject: Re: making pre-build headers
- From: Bruce Korb <bkorb at sco dot COM>
- Date: Tue, 31 Oct 2000 12:55:34 -0800
- CC: autoconf at gnu dot org, automake at gnu dot org
- List-Id: Discussion list for automake <automake.gnu.org>
- Organization: The Santa Cruz Operation
- References: <200010312030.OAA20555@shell.datasync.com>
Paul Martinolich wrote:
>
> I am using automake/autoconf and am in a situation in which I need
> to use a program to generate a header file using a template file
> before I can compile the program. Has anyone encountered a similiar
> situation? What is the best way to accomplish this? Suggestions.
>
> Thanks, Paul
Two ways, depending on how clean the separation is between
the header you create and the sources you are compiling.
If the header is *NOT* derived from the sources you compile,
then add this to Makefile.am:
mumble.h : <whatever>
<whatever-you-gotta-do> -o $@
Otherwise, do this:
$(OBJLIST) : mumble-stamp
mumble-stamp :
<whatever-you-gotta-do> -o mumble.h
touch mumble-stamp
I also generally add this:
GENSRC = mumble.h
gen : $(GENSRC)
mumble.h : <whatever>
<whatever-you-gotta-do> -o $@
so I can decide to type, "make gen" and be sure my
generated files are up-to-date. It is ugly. Especially
when the automated dependencies come along and decide
that your objects depend on mumble.h and mumble.h depends
on your sources and you modified your sources, so it
must be time to regenerate the mumble.h and recompile everything.
Maybe we need a ``.dependignore'' a la ``.cvsignore'' :-)