help-make
[Top][All Lists]
Advanced

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

Re: VPATH and Makefiles


From: David Boyce
Subject: Re: VPATH and Makefiles
Date: Tue, 22 Jun 2004 21:27:44 -0400

At 07:31 PM 6/22/2004, Paul D. Smith wrote:
%% Boris Kolpackov <address@hidden> writes:
  bk> Even -I won't help him/her to do what he/she wants since only included
  bk> makefiles are searched in -I-directories. What the original poster
  bk> wanted is to be able to have let's say /tmp/makefile and then

  bk> $ make -I /tmp

Ah, good point; I didn't see that.  Correct, nothing like that will work.

However, you can do this:

    $ export MAKEFILES=/tmp/makefile
        ...
    $ make

Not quite the same thing but perhaps it's helpful.

I've often wished for the equivalent of the Ant "-find" feature to be implemented in make. This would simply ask make to work its way up toward the root looking for a makefile in each intervening directory and stopping when one is found. Basically a recursive version of the current makefile-finding algorithm. It would allow you to run make in any subdir of a large project tree with only a single Makefile at its base (or e.g. a Makefile for each of the 'cmd', 'lib', and 'doc' subtrees), thus removing one of the ergonomic problems with single-makefile (non-recursive) build models. Of course the same thing can be handled with an array of symlinks or a wrapper script or whatever but these come with their own costs.

Although the example above uses /tmp for the usual reasons, in real life makefiles - like other source files - are liable to be found within the current project's tree. And most SW build layouts are organized such that searching up makes sense.

It's hard to imagine this hasn't been considered before. If so, was there a persuasive argument against it?

-David Boyce





reply via email to

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