Ethereal-dev: Re: [ethereal-dev] Automatically generating "proto_register_XXX()" calls

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Thu, 21 Oct 1999 16:48:11 -0500
On Thu, Oct 21, 1999 at 04:25:39PM -0500, Guy Harris wrote:
> 
> 
> > And the sources should be in the same directory as where the build is
> > taking place. I like to have a serarate buildtree, so the cvs update
> > won't complain so much, and the new auto-generated solution does not
> > work in that case.
> 
> When you do this, how do you tell "make" to look for source in a
> directory other than the directory into which you're putting the object
> files and executable image? The stuff to generate "register.c" needs to
> know that, so that it knows the directory to search for the source.

The $(srcdir) variable. E.g.:

ps.c: print.ps rdps
        ./rdps $(srcdir)/print.ps ps.c

rdps: rdps.c
        $(CC) -o rdps $(srcdir)/rdps.c

randpkt.o: randpkt.c
        $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c

Hmmmm. Should the dependency lines have $(srcdir) too? I'm not sure.

--gilbert