diff options
author | Niels Thykier <niels@thykier.net> | 2018-02-18 08:03:42 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2018-02-18 08:05:55 +0000 |
commit | f8d7a6ead49e747430124bcea4b55ba05157d4b4 (patch) | |
tree | f8c736397e9dd221c994f9a982c30384311b60ec /lib/Debian/Debhelper/Buildsystem/makefile.pm | |
parent | e6b3ba49d0e1504966eaeb58dca280ea3c8310bc (diff) | |
download | debhelper-f8d7a6ead49e747430124bcea4b55ba05157d4b4.tar.gz |
makefile: Pass -O to make with -jX
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'lib/Debian/Debhelper/Buildsystem/makefile.pm')
-rw-r--r-- | lib/Debian/Debhelper/Buildsystem/makefile.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/makefile.pm b/lib/Debian/Debhelper/Buildsystem/makefile.pm index 241e8b2a..296110df 100644 --- a/lib/Debian/Debhelper/Buildsystem/makefile.pm +++ b/lib/Debian/Debhelper/Buildsystem/makefile.pm @@ -80,7 +80,15 @@ sub do_make { clean_jobserver_makeflags(); # Note that this will override any -j settings in MAKEFLAGS. - unshift @_, "-j" . ($this->get_parallel() > 0 ? $this->get_parallel() : ""); + my $parallel = $this->get_parallel(); + if ($parallel == 0 or $parallel > 1) { + # We have to use the empty string for "unlimited" + $parallel = '' if $parallel == 0; + # -O is for synchronizing the output. + unshift(@_, "-j${parallel}", '-O'); + } else { + unshift(@_, '-j1'); + } my @root_cmd; if (exists($this->{_run_make_as_root}) and $this->{_run_make_as_root}) { |