automake
[Top][All Lists]
Advanced

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

Re: Use of vpath to build objects in separate directories


From: Paul D. Smith
Subject: Re: Use of vpath to build objects in separate directories
Date: 11 Sep 2001 15:33:04 -0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

%% Regarding Use of vpath to build objects in separate directories;
%% Brian Appel <address@hidden> writes:

  ba> I know vpath can be used to cause object files to be written to a
  ba> directory tree separate from the original source.

No, it can't.

  ba> In fact, if I run configure in my separate destination directory,
  ba> it builds Makefiles there and I can perform the make there.
  ba> However, suppose I want to be able to initiate the make while in
  ba> the source tree, instead of in the object tree?

You can't do that with VPATH.  The only way to do it is put full paths
to the object directory in your makefiles.

You can do this is a relatively automated manner, if you want, so that
"normal" writers of makefiles don't need to see this.  But, it has to be
there for make to see.

  ba> In the past on this project, this kind of a thing was accomplished
  ba> using a simple script which wrapped gnumake.  It would change
  ba> directories from the source tree to the corresponding object tree,
  ba> copy the makefile if necessary, and then run the make in the
  ba> object tree (using vpath so that make would find the source).
  ba> This was rather simple and allowed developers to execute makes
  ba> while editing files without having to remember to change
  ba> directories to where they wanted the object files to go (they
  ba> would just execute the make from the source directory).

This will still work, of course.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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