From: Sam Ravnborg Date: Sun, 15 Jan 2006 19:02:31 +0000 (+0100) Subject: kbuild: fix make -jN with multiple targets with O=... X-Git-Tag: v2.6.16-rc1~95^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=296e0855b0f9a4ec9be17106ac541745a55b2ce1;p=linux-2.6 kbuild: fix make -jN with multiple targets with O=... The way multiple targets was handled with make O=... broke because for each high-level target make spawned a parallel make resulting in a broken build. Reported by Keith Owens Signed-off-by: Sam Ravnborg --- diff --git a/Makefile b/Makefile index deedaf79cd..b3dd9dbdc2 100644 --- a/Makefile +++ b/Makefile @@ -106,12 +106,13 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) $(if $(KBUILD_OUTPUT),, \ $(error output directory "$(saved-output)" does not exist)) -.PHONY: $(MAKECMDGOALS) +.PHONY: $(MAKECMDGOALS) cdbuilddir +$(MAKECMDGOALS) _all: cdbuilddir -$(filter-out _all,$(MAKECMDGOALS)) _all: +cdbuilddir: $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ KBUILD_SRC=$(CURDIR) \ - KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@ + KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $(MAKECMDGOALS) # Leave processing to above invocation of make skip-makefile := 1