diff options
Diffstat (limited to 'lib/Debian/Debhelper')
-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}) { |