public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Support parallel make check with GNU make 4.2+
@ 2018-07-20 11:13 Rainer Orth
  2018-07-20 11:33 ` Andreas Schwab
  2018-07-25 19:07 ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Rainer Orth @ 2018-07-20 11:13 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

I noticed that make -jN check would run make check-single when using GNU
make 4.2.1.

In the end, it turned out that this is due to this change from the make
4.2 NEWS file:

* The amount of parallelism can be determined by querying MAKEFLAGS, even when
  the job server is enabled (previously MAKEFLAGS would always contain only
  "-j", with no number, when job server was enabled).

The fix is trivial: just accept an optional arg to -j in Makefile.in
(saw_dash_j).  Tested on i386-pc-solaris2.11 with just make and make
-j/-jN with both make 3.82 and 4.2.1.

Ok for master?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-06-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* Makefile.in (saw_dash_j): Allow for GNU make 4.2+ passing -jN in
	MAKEFLAGS.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-make42-check.patch --]
[-- Type: text/x-patch, Size: 809 bytes --]

# HG changeset patch
# Parent  c46bee26ae481e40fea09b4bbdb35731ff6b354c
Support parallel make check with GNU make 4.2+

diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -140,7 +140,7 @@ installcheck:
 # See whether -j was given to make.  Either it was given with no
 # arguments, and appears as "j" in the first word, or it was given an
 # argument and appears as "-j" in a separate word.
-saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j,$(MAKEFLAGS)))
+saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j%,$(MAKEFLAGS)))
 
 # Try to run the tests in parallel if any -j option is given.  If RUNTESTFLAGS
 # is not empty, then by default the tests will be serialized.  This can be

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support parallel make check with GNU make 4.2+
  2018-07-20 11:13 Support parallel make check with GNU make 4.2+ Rainer Orth
@ 2018-07-20 11:33 ` Andreas Schwab
  2018-07-25 19:07 ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2018-07-20 11:33 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb-patches

On Jul 20 2018, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:

> diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
> --- a/gdb/testsuite/Makefile.in
> +++ b/gdb/testsuite/Makefile.in
> @@ -140,7 +140,7 @@ installcheck:
>  # See whether -j was given to make.  Either it was given with no
>  # arguments, and appears as "j" in the first word, or it was given an
>  # argument and appears as "-j" in a separate word.
> -saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j,$(MAKEFLAGS)))
> +saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j%,$(MAKEFLAGS)))

Please also update the comment.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support parallel make check with GNU make 4.2+
  2018-07-20 11:13 Support parallel make check with GNU make 4.2+ Rainer Orth
  2018-07-20 11:33 ` Andreas Schwab
@ 2018-07-25 19:07 ` Tom Tromey
  2018-08-07 11:23   ` Rainer Orth
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2018-07-25 19:07 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb-patches

>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

Rainer> The fix is trivial: just accept an optional arg to -j in Makefile.in
Rainer> (saw_dash_j).  Tested on i386-pc-solaris2.11 with just make and make
Rainer> -j/-jN with both make 3.82 and 4.2.1.

Rainer> Ok for master?

Thanks for doing this, and nice work noticing it.
This is OK if you first fix the nit that Andreas pointed out.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support parallel make check with GNU make 4.2+
  2018-07-25 19:07 ` Tom Tromey
@ 2018-08-07 11:23   ` Rainer Orth
  0 siblings, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2018-08-07 11:23 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

Hi Tom,

>>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
> Rainer> The fix is trivial: just accept an optional arg to -j in Makefile.in
> Rainer> (saw_dash_j).  Tested on i386-pc-solaris2.11 with just make and make
> Rainer> -j/-jN with both make 3.82 and 4.2.1.
>
> Rainer> Ok for master?
>
> Thanks for doing this, and nice work noticing it.
> This is OK if you first fix the nit that Andreas pointed out.

here's what I've checked in.

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-06-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* Makefile.in (saw_dash_j): Allow for GNU make 4.2+ passing -jN in
	MAKEFLAGS.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-make42-check.patch --]
[-- Type: text/x-patch, Size: 1127 bytes --]

# HG changeset patch
# Parent  4aa118a772bdc3c80b028bbb31ccbe3866b6199e
Support parallel make check with GNU make 4.2+

diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -137,10 +137,11 @@ uninstall: force
 
 installcheck:
 
-# See whether -j was given to make.  Either it was given with no
-# arguments, and appears as "j" in the first word, or it was given an
-# argument and appears as "-j" in a separate word.
-saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j,$(MAKEFLAGS)))
+# See whether -j was given to make.  Before GNU make 4.2, either it was
+# given with no arguments, and appears as "j" in the first word, or it was
+# given an argument and appears as "-j" in a separate word.  Starting with
+# GNU make 4.2, it always appears as "-j"/"-jN" in a separate word.
+saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j%,$(MAKEFLAGS)))
 
 # Try to run the tests in parallel if any -j option is given.  If RUNTESTFLAGS
 # is not empty, then by default the tests will be serialized.  This can be

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-07 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20 11:13 Support parallel make check with GNU make 4.2+ Rainer Orth
2018-07-20 11:33 ` Andreas Schwab
2018-07-25 19:07 ` Tom Tromey
2018-08-07 11:23   ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).