~ubuntu-branches/ubuntu/lucid/debhelper/lucid

« back to all changes in this revision

Viewing changes to Debian/Debhelper/Buildsystem/makefile.pm

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-02-11 19:02:31 UTC
  • mfrom: (1.4.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100211190231-arh2wkqq4m6w4mtj
Tags: 7.4.13ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - dh_installinit: Add --upstart-only and --onlyscripts-upstart modes.
  - Add various autoscripts for above: postinst-upstart,
    postinst-upstart-replace, postinst-upstart-restart,
    prerm-upstart, prerm-upstart-norestart, preinst-removeconffile.
  - dh_installudev: Handle conffile migration from old Ubuntu defaults
    (needed until after the next LTS release).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
use Debian::Debhelper::Dh_Lib qw(escape_shell clean_jobserver_makeflags);
11
11
use base 'Debian::Debhelper::Buildsystem';
12
12
 
13
 
sub get_makecmd_C {
14
 
        my $this=shift;
15
 
        my $buildpath = $this->get_buildpath();
16
 
        if ($buildpath ne '.') {
17
 
                return $this->{makecmd} . " -C " . escape_shell($buildpath);
18
 
        }
19
 
        return $this->{makecmd};
20
 
}
21
 
 
22
13
sub exists_make_target {
23
14
        my ($this, $target) = @_;
24
 
        my $makecmd=$this->get_makecmd_C();
25
15
 
26
16
        # Use make -n to check to see if the target would do
27
17
        # anything. There's no good way to test if a target exists.
28
 
        my $ret=`$makecmd -s -n --no-print-directory $target 2>/dev/null | head -n 1`;
29
 
        chomp $ret;
30
 
        return length($ret);
 
18
        my @opts=("-s", "-n", "--no-print-directory");
 
19
        my $buildpath = $this->get_buildpath();
 
20
        unshift @opts, "-C", $buildpath if $buildpath ne ".";
 
21
        open(SAVEDERR, ">&STDERR");
 
22
        close STDERR;
 
23
        open(MAKE, "-|", $this->{makecmd}, @opts, $target);
 
24
        my $output=<MAKE>;
 
25
        close MAKE;
 
26
        open(STDERR, ">&SAVEDERR");
 
27
        return defined $output && length $output;
31
28
}
32
29
 
33
30
sub do_make {