summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Debhelper/Buildsystem/makefile.pm22
-rwxr-xr-xt/buildsystems/buildsystem_tests2
2 files changed, 18 insertions, 6 deletions
diff --git a/Debian/Debhelper/Buildsystem/makefile.pm b/Debian/Debhelper/Buildsystem/makefile.pm
index d4b68e4c..f38387bd 100644
--- a/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/Debian/Debhelper/Buildsystem/makefile.pm
@@ -69,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 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 {
diff --git a/t/buildsystems/buildsystem_tests b/t/buildsystems/buildsystem_tests
index c6f23ca5..3b45ac5e 100755
--- a/t/buildsystems/buildsystem_tests
+++ b/t/buildsystems/buildsystem_tests
@@ -256,7 +256,7 @@ touch "$tmpdir/configure", 0755;
test_check_auto_buildable($bs{autoconf}, "configure", { configure => 1 });
touch "$tmpdir/CMakeLists.txt";
-test_check_auto_buildable($bs{cmake}, "CMakeLists.txt", { configure => 1 });
+test_check_auto_buildable($bs{cmake}, "CMakeLists.txt", { configure => 1, clean => 1 });
touch "$tmpdir/Makefile.PL";
test_check_auto_buildable($bs{perl_makemaker}, "Makefile.PL", { configure => 1 });