diff options
author | Modestas Vainius <modax@debian.org> | 2011-07-21 14:48:57 +0300 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-08-05 13:43:02 -0400 |
commit | f2123b6963a0c59d4901037f519376c1ce660177 (patch) | |
tree | ac7771427a704ca728f2f55217ad7299c3f8cf50 /Debian/Debhelper/Buildsystem | |
parent | 7da05db96ef52c0f3367538c2b197341484a70c2 (diff) |
makefile.pm: remove build directory even if Makefile does not exist yet.
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.
Diffstat (limited to 'Debian/Debhelper/Buildsystem')
-rw-r--r-- | Debian/Debhelper/Buildsystem/makefile.pm | 22 |
1 files changed, 17 insertions, 5 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 { |