automake
[Top][All Lists]
Advanced

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

Re: VPATH and Relative vs. Absolute pathnames


From: John Darrington
Subject: Re: VPATH and Relative vs. Absolute pathnames
Date: Mon, 8 Dec 2003 10:03:51 +0800
User-agent: Mutt/1.3.28i

On Sun, Dec 07, 2003 at 09:24:30AM -0600, Bob Friesenhahn wrote:
     On Sun, 7 Dec 2003, John Darrington wrote:
     
     > Is there any way to instruct automake to only use relative pathnames
     > in its makefile?  This way, one could actually use the VPATH feature,
     > which is essential if you're building a project under certain CM
     > systems.
     
     In conjunction with Autoconf, Automake already provides the ability to
     build from outside of the source tree.  

That's a good feature, but not the same thing.


     What purpose do you need to use VPATH for?

Tools such as aegis place source files in a  heirachial way.  There
might be three (or more) repositories where source is found, and there is
a defined search order.  For example if a project has three files,
src1.c src2.c and src3.c at any one time they might be located at
follows:

/work/foo/baseline/src1.c
/work/foo/branch1/baseline/src2.c
/home/john/development/foo/src3.c


Typically there are three ways to manage this situation:

1.  Create symbolic links from the top of the vsearch path to the
    actual files.  (Doesn't scale well for large projects).

2.  Use a translucent/union/stacking filesystem.  Should work ok, but
    very few systems have such features at the moment.

3.  Use the VPATH feature of Make


In my opionion, 3 is the simplest and easiest, you would just set, in
this example: 
 VPATH=/home/john/development/foo:/work/foo/branch1/baseline:/work/foo/baseline

then when make comes across a rule like

%.o: %.c
     $(CC) -c -o $@ $<

it magically picks the correct thing.

However autoconf/automake breaks everything, because it puts absolute
paths in the targets and/or dependencies

J'


     

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://wwwkeys.pgp.net or any PGP keyserver for public key.


Attachment: pgpYin_ybSlGE.pgp
Description: PGP signature


reply via email to

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