Mail Archives: djgpp/2003/08/15/07:15:04
Geoff Robinson <geoffr2 AT aol DOT com> wrote:
> other user-defined files. The user has a project directory and a
> common directory they use. Compiling stuff from the project directory
> no problem. But a situation may arise where files from both of the
> user's directories need to be compiled.
That's not much of a problem, as far as make is concerned, *if* you can
do one of two things:
1) compile the files sitting in the "common" directory by running a recursive
invocation of make over there, like this:
$(MAKE) -C $(common_dir)
2) have all .o files, from both source file storage directories, end up
in the directory you're running make in.
In the first case, you can get away with a single rule that executes
the recursive make for all .o files in the common directory, in the
second you can use VPATH to find files in both source directories.
Or you can give up the lazy approach and write explicit rules for every
source file.
In the end, makefiles alone may not be enough. There are cases where
you really need more tools, up to and including ones that generate
makefiles from outlines, or that generate makefile fragments on
request. Or maybe make simply isn't up to the task you're trying to
solve. Other tools, including Ant, may be worth trying.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -