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
13 lines
391 B
Makefile
13 lines
391 B
Makefile
MAKEPARALLEL ?= ./makeparallel
|
|
|
|
.PHONY: test
|
|
test:
|
|
@+echo MAKEFLAGS=$${MAKEFLAGS}; \
|
|
result=$$($(MAKEPARALLEL) echo); \
|
|
echo result: $${result}; \
|
|
if [ "$${result}" = "$(EXPECTED)" ]; then \
|
|
echo SUCCESS && echo; \
|
|
else \
|
|
echo FAILED expected $(EXPECTED) && false; \
|
|
fi
|