[3/3] make: Don't set $(MAKEFLAGS)

Submitted by Dmitry Safonov on April 19, 2018, 3:22 a.m.


Message ID 20180419032255.4844-4-dima@arista.com
State Accepted
Series "make: Fix parallel build for zdtm"
Commit 443945408806875ad8fdc2d0a913df9b93f68879
Headers show

Commit Message

Dmitry Safonov April 19, 2018, 3:22 a.m.
We shouldn't set MAKEFLAGS by the following reasons:
1. User may want to specify some make parameter (e.g., `-d` for debug)
2. We lose parallel build. No `-j` is passed to submake and it looks
   like, gnu/make will not deal with parallel recursive make if
   $(MAKEFLAGS) is unset back.
   Easy to verify: Add `sleep 3` to build rule in Makefile.inc and
   you'll find only one sleep process at a time. After the patch
   if you specify say `-j5` to make - you'll have 5 sleep processes.

Reverts: commit e9beed7bb3f3 ("build: zdtm -- Add implicit rules into
zdtm building").

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/Makefile b/Makefile
index bdfb55b26921..558963914e9c 100644
--- a/Makefile
+++ b/Makefile
@@ -278,11 +278,11 @@  docs:
 .PHONY: docs
 zdtm: all
-	$(Q) MAKEFLAGS= $(MAKE) -C test/zdtm all
+	$(Q) $(MAKE) -C test/zdtm all
 .PHONY: zdtm
 test: zdtm
-	$(Q) MAKEFLAGS= $(MAKE) -C test
+	$(Q) $(MAKE) -C test
 .PHONY: test