package Debian::Debhelper::Buildsystem::makefile;
use strict;
-use Debian::Debhelper::Dh_Lib qw(escape_shell);
+use Debian::Debhelper::Dh_Lib qw(escape_shell clean_jobserver_makeflags);
use base 'Debian::Debhelper::Buildsystem';
sub get_makecmd_C {
return length($ret);
}
+sub do_make {
+ my $this=shift;
+
+ # Avoid possible warnings about unavailable jobserver,
+ # and force make to start a new jobserver.
+ clean_jobserver_makeflags();
+
+ # Note that this will override any -j settings in MAKEFLAGS.
+ unshift @_, "-j" . ($this->get_parallel() > 0 ? $this->get_parallel() : "");
+
+ $this->doit_in_builddir($this->{makecmd}, @_);
+}
+
sub make_first_existing_target {
my $this=shift;
my $targets=shift;
foreach my $target (@$targets) {
if ($this->exists_make_target($target)) {
- $this->doit_in_builddir($this->{makecmd}, $target, @_);
+ $this->do_make($target, @_);
return $target;
}
}
sub build {
my $this=shift;
- $this->doit_in_builddir($this->{makecmd}, @_);
+ $this->do_make(@_);
}
sub test {