[Top][All Lists]

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

Re: making pre-build headers

From: Bruce Korb
Subject: Re: making pre-build headers
Date: Tue, 31 Oct 2000 12:55:34 -0800

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

   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'' :-)

reply via email to

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