]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem/makefile.pm
debhelper: Fix minor source comment typos.
[debhelper.git] / Debian / Debhelper / Buildsystem / makefile.pm
index e106ffd0c545339d2373446b3abc9d11ba2ea6b0..c63b58eda934c6017ec2d0689e71f89983c78073 100644 (file)
@@ -22,6 +22,7 @@ sub exists_make_target {
        open(STDERR, ">/dev/null");
        open(MAKE, "-|", $this->{makecmd}, @opts, $target);
        my $output=<MAKE>;
+       chomp $output;
        close MAKE;
        open(STDERR, ">&SAVEDERR");
        return defined $output && length $output;
@@ -68,11 +69,23 @@ sub check_auto_buildable {
        my $this=shift;
        my ($step) = @_;
 
-       # This is always called in the source directory, but generally
-       # Makefiles are created (or live) in the the build directory.
-       return (-e $this->get_buildpath("Makefile") ||
-               -e $this->get_buildpath("makefile") ||
-               -e $this->get_buildpath("GNUmakefile")) ? 1 : 0;
+       if (-e $this->get_buildpath("Makefile") ||
+           -e $this->get_buildpath("makefile") ||
+           -e $this->get_buildpath("GNUmakefile"))
+       {
+               # This is always called in the source directory, but generally
+               # Makefiles are created (or live) in the build directory.
+               return 1;
+       } elsif ($step eq "clean" && defined $this->get_builddir() &&
+                $this->check_auto_buildable("configure"))
+       {
+               # Assume that the package can be cleaned (i.e. the build directory can
+               # be removed) as long as it is built out-of-source tree and can be
+               # configured. This is useful for derivative buildsystems which
+               # generate Makefiles.
+               return 1;
+       }
+       return 0;
 }
 
 sub build {
@@ -88,7 +101,9 @@ sub test {
 sub install {
        my $this=shift;
        my $destdir=shift;
-       $this->make_first_existing_target(['install'], "DESTDIR=$destdir", @_);
+       $this->make_first_existing_target(['install'],
+               "DESTDIR=$destdir",
+               "AM_UPDATE_INFO_DIR=no", @_);
 }
 
 sub clean {