[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with parallel make
From: |
Paul D. Smith |
Subject: |
Re: Problem with parallel make |
Date: |
Sun, 30 Jul 2006 10:02:30 -0400 |
%% Lee Killough <address@hidden> writes:
lk> I can find no documentation on the + option, other than the
lk> documentation on the message, which says to use +.
If you look in the index you'll find pointers to both the section
"Instead of Executing the Commands" and "How the `MAKE' Variable Works",
each of which contains a description.
lk> I read somewhere that the presence of the string $(MAKE) in the
lk> unexpanded command was all that was necessary for make to detect
lk> recursive commands, but that appears false.
No, it's true. The problem, as you discovered, is that you're closing
(one of) the file descriptors make is using to manage the jobserver.
The submake can't know that that's why the descriptor is closed, so it
assumes that it's the much more common situation where the parent
makefile invoked "make" rather than "$(MAKE)" etc.
lk> PS. I just answered my own question. Question and answer here for
lk> others' reference, although I'd still like more detailed
lk> information about the precise semantics of + and the jobserver's
lk> operation:
As above, "+" _is_ explained pretty straightforwardly in the GNU make
manual.
Try looking here for more info on the jobserver:
http://make.paulandlesley.org/jobserver.html
lk> Perhaps a larger filehandle number, less likely to occur in common
lk> shell redirection idioms, should be used for the jobserver.
Well, pipe(2) doesn't allow you to choose your own file descriptors: it
just uses the lowest available descriptors. I could use dup2(2) to
force different ones after the pipe has been created, but there's no
portable way in POSIX (that I know of) to find the maximum valid file
descriptor. I guess we could just use OPEN_MAX, if we can figure it
out.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> 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