diff mbox series

[iproute2] build: avoid make jobserver warnings

Message ID 20200921232231.11543-1-jengelh@inai.de
State New
Headers show
Series [iproute2] build: avoid make jobserver warnings | expand

Commit Message

Jan Engelhardt Sept. 21, 2020, 11:22 p.m. UTC
I observe:

	» make -j8 CCOPTS=-ggdb3
	lib
	make[1]: warning: -j8 forced in submake: resetting jobserver mode.
	make[1]: Nothing to be done for 'all'.
	ip
	make[1]: warning: -j8 forced in submake: resetting jobserver mode.
	    CC       ipntable.o

MFLAGS is a historic variable of some kind; removing it fixes the
jobserver issue.
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stephen Hemminger Sept. 22, 2020, 12:19 a.m. UTC | #1
On Tue, 22 Sep 2020 01:22:31 +0200
Jan Engelhardt <jengelh@inai.de> wrote:

> I observe:
> 
> 	» make -j8 CCOPTS=-ggdb3
> 	lib
> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.
> 	make[1]: Nothing to be done for 'all'.
> 	ip
> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.
> 	    CC       ipntable.o
> 
> MFLAGS is a historic variable of some kind; removing it fixes the
> jobserver issue.

MFLAGS is a way to pass flags from original make into the sub-make.
Not sure if it is used anywhere else.
Jan Engelhardt Sept. 22, 2020, 6:15 a.m. UTC | #2
On Tuesday 2020-09-22 02:19, Stephen Hemminger wrote:
>> I observe:

>> 

>> 	» make -j8 CCOPTS=-ggdb3

>> 	lib

>> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.

>> 	make[1]: Nothing to be done for 'all'.

>> 	ip

>> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.

>> 	    CC       ipntable.o

>> 

>> MFLAGS is a historic variable of some kind; removing it fixes the

>> jobserver issue.

>

>MFLAGS is a way to pass flags from original make into the sub-make.


MAKEFLAGS and MFLAGS are already exported by make (${MAKE} is magic
methinks), so they need no explicit passing. You can check this by
adding something like 'echo ${MAKEFLAGS}' to the lib/Makefile
libnetlink.a target and then invoking e.g. `make -r` from the
toplevel, and notice how -r shows up again in the submake.
Stephen Hemminger Sept. 24, 2020, 4:11 p.m. UTC | #3
On Tue, 22 Sep 2020 08:15:59 +0200 (CEST)
Jan Engelhardt <jengelh@inai.de> wrote:

> On Tuesday 2020-09-22 02:19, Stephen Hemminger wrote:

> >> I observe:

> >> 

> >> 	» make -j8 CCOPTS=-ggdb3

> >> 	lib

> >> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.

> >> 	make[1]: Nothing to be done for 'all'.

> >> 	ip

> >> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.

> >> 	    CC       ipntable.o

> >> 

> >> MFLAGS is a historic variable of some kind; removing it fixes the

> >> jobserver issue.  

> >

> >MFLAGS is a way to pass flags from original make into the sub-make.  

> 

> MAKEFLAGS and MFLAGS are already exported by make (${MAKE} is magic

> methinks), so they need no explicit passing. You can check this by

> adding something like 'echo ${MAKEFLAGS}' to the lib/Makefile

> libnetlink.a target and then invoking e.g. `make -r` from the

> toplevel, and notice how -r shows up again in the submake.


For context:
https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html

With your change does the options through the same?
My concern is that this change might break how distros do their package builds,
and cross compilation.
Jan Engelhardt Sept. 24, 2020, 4:56 p.m. UTC | #4
On Thursday 2020-09-24 18:11, Stephen Hemminger wrote:
>> >
>> >MFLAGS is a way to pass flags from original make into the sub-make.  
>> 
>> MAKEFLAGS and MFLAGS are already exported by make (${MAKE} is magic
>> methinks), so they need no explicit passing. You can check this by
>> adding something like 'echo ${MAKEFLAGS}' to the lib/Makefile
>> libnetlink.a target and then invoking e.g. `make -r` from the
>> toplevel, and notice how -r shows up again in the submake.
>
>With your change does the options through the same?

Well yes.
Stephen Hemminger Sept. 28, 2020, 3:39 p.m. UTC | #5
On Thu, 24 Sep 2020 18:56:33 +0200 (CEST)
Jan Engelhardt <jengelh@inai.de> wrote:

> On Thursday 2020-09-24 18:11, Stephen Hemminger wrote:
> >> >
> >> >MFLAGS is a way to pass flags from original make into the sub-make.    
> >> 
> >> MAKEFLAGS and MFLAGS are already exported by make (${MAKE} is magic
> >> methinks), so they need no explicit passing. You can check this by
> >> adding something like 'echo ${MAKEFLAGS}' to the lib/Makefile
> >> libnetlink.a target and then invoking e.g. `make -r` from the
> >> toplevel, and notice how -r shows up again in the submake.  
> >
> >With your change does the options through the same?  
> 
> Well yes.

Ok, tested a number of cases, and this works for all of them.

But, the patch is missing Signed-off-by which is required for iproute2.
Please resend with DCO.
Stephen Hemminger Sept. 28, 2020, 8:52 p.m. UTC | #6
On Mon, 28 Sep 2020 21:08:01 +0200
Jan Engelhardt <jengelh@inai.de> wrote:

> I observe:

> 

> 	» make -j8 CCOPTS=-ggdb3

> 	lib

> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.

> 	make[1]: Nothing to be done for 'all'.

> 	ip

> 	make[1]: warning: -j8 forced in submake: resetting jobserver mode.

> 	    CC       ipntable.o

> 

> MFLAGS is a historic variable of some kind; removing it fixes the

> jobserver issue.

> 

> Signed-off-by: Jan Engelhardt <jengelh@inai.de>


Applied.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index cadda235..5b040415 100644
--- a/Makefile
+++ b/Makefile
@@ -63,7 +63,7 @@  LDLIBS += $(LIBNETLINK)
 all: config.mk
 	@set -e; \
 	for i in $(SUBDIRS); \
-	do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done
+	do echo; echo $$i; $(MAKE) -C $$i; done
 
 .PHONY: clean clobber distclean check cscope version
 
@@ -101,11 +101,11 @@  version:
 
 clean:
 	@for i in $(SUBDIRS) testsuite; \
-	do $(MAKE) $(MFLAGS) -C $$i clean; done
+	do $(MAKE) -C $$i clean; done
 
 clobber:
 	touch config.mk
-	$(MAKE) $(MFLAGS) clean
+	$(MAKE) clean
 	rm -f config.mk cscope.*
 
 distclean: clobber