%% "Robert P. J. Day" <[EMAIL PROTECTED]> writes:
rpjd> i'm reading paul smith's essay on multi-architecture builds
rpjd> (http://make.paulandlesley.org/multi-arch.html), but it seems
rpjd> that that approach wouldn't work if one had a recursive make
rpjd> structure, would it?
Sure.
rpjd> that is, say one had the source directory SRCDIR and the
rpjd> directory in which to build the objects OBJDIR, the *general*
rpjd> form of the make invocation would be (simplified drastically for
rpjd> brevity):
rpjd> $ cd ${SRCDIR}
rpjd> $ make -C ${OBJDIR} -f ${SRCDIR}/Makefile <target>
rpjd> that would work fine for simple targets, but if the Makefile had
rpjd> a recursive structure that tried to "make" into SRCDIR's
rpjd> subdirectories, it seems this would fail as the make (running
rpjd> effectively in OBJDIR) would try to locate the subdirectories in
rpjd> OBJDIR, not SRCDIR, would fail to find them, and abort, no? (a
rpjd> quick test seems to verify this behaviour.)
No...
The model is this: you run the make in the source directory. That is
sort of the "master" make. It will invoke a sub-make in the target
directory in order to build all the local targets.
_BUT_, that sub-make doesn't try to build any subdirectories. Instead,
once the sub-make is done building the local targets it exits. Then
it's up to the parent make (in the source directory) to run any
sub-makes.
In short, you want to put any recursion into the section of the makefile
that's invoked in the source directory, not the section invoked in the
target directory.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/help-make