Commit graph

3 commits

Author SHA1 Message Date
Colin Cross
466ea35202 makeparallel: prepend flags to ninja command line
Ninja stops parsing top level options after -t is used to select a
tool.  Put any inserted command line options at the beginning of the
command.

Change-Id: I2ba903143366aaded63e21d749476248617c8962
2015-10-20 17:05:49 -07:00
Colin Cross
69047fab7e makeparallel: improve support for wrapping ninja
Allow makeparallel to pass better -j and -k arguments to ninja if the
first argument to makeparallel is --ninja.  Uses getopt to parse
MAKEFLAGS to get values for --jobserver-fds, -k, and -j, and uses the
result to not pass any -j argument to ninja for make -j with no number,
and pass -k0 to ninja for make -k.

Also improve the test makefile to provide many more tests.

Bug: 24199503
Change-Id: Id6481430f77e9e952213be58a98fe78c46ee5d6a
2015-09-18 15:02:40 -07:00
Colin Cross
a55544875a Implement makeparallel
makeparallel communicates with the GNU make jobserver
(http://make.mad-scientist.net/papers/jobserver-implementation/)
in order claim all available jobs, and then passes the number of jobs
claimed to a subprocess with -j<jobs>.

Change-Id: Id41a2d81e0d835517da8ba52c818c763fc455c14
2015-09-14 14:33:50 -07:00