Mail Archives: djgpp/2003/08/14/13:30:04
Geoff Robinson <geoffr2 AT aol DOT com> wrote:
> I can't get this thing to work. Do you know of any Windows-based
> examples I could look at?
No. The main reason for that being that your way of spreading source
files all over the place is rather unusual, to put it mildly.
> I'm finding it exceedingly hard to find documentation for this
> specific problem.
The real problem is that you're trying to be lazy and stubborn at the
same time, and that can't usually work. Now I'll have to eplain what
I mean with this...
I say "lazy" because you want to avoid writing explicit rules for
individual .o files, but rather use a simplistic "makefile template"
with minimal modifications. With indiviudal rules and explicit
commands for each of them, you could quite easily place your files
wherever you want, and have object files and source files in
completely unrelated directories. But your makefile would be a lot
longer than in your current plan.
And I say "stubborn" because you don't seem to be willing/able to
adapt your source file storage pattern to the expectations built into
make. Those expectations form the basis of features inside make that
are there exactly to allow laziness. Among those tools in GNU make
you're shutting yourself off of by your sourcefile placement, the most
prominent are implicit suffix rules and the VPATH feature, which would
help you to avoid writing repetitive stuff into your makefile all the
time, if you let them. But you would have to refrain from using
absolute paths to source files inside your makefile to fully exploit
these features.
Summing this up Your sourcefile layout is rather awkward and unusual,
and that's where all your problems with make really come from.
Source files used in the same project should not generally be spread
across several different unrelated directories. If they belong to the
same project, they really should all be in its source tree. If they
don't, it's none of the project makefile's business how to compile
them --- they should be in pre-built libraries instead, and/or
maintained by a recursive invocation of 'make'.
> Secondly, I'm not sure if there is any way around putting in a drive
> letter. That may be a problem, but I'm willing to accept the risk.
Drive letters aren't actually all that bad. Backslashes are worse.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -