#1132823 dh_auto_clean: please prefer maintainer-clean makefile target

Package:
debhelper
Source:
debhelper
Submitter:
Nicolas Boulenguez
Date:
2026-06-07 13:27:02 UTC
Severity:
normal
Tags:
#1132823#5
Date:
2026-04-06 06:45:09 UTC
From:
To:
Hello.
According to
https://www.gnu.org/software/make/manual/html_node/Standard-Targets.html
the maintainer-clean target removes more files than distclean,
so it should be preferred when available.
--- a/lib/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/lib/Debian/Debhelper/Buildsystem/makefile.pm
@@ -199,7 +199,7 @@
 sub clean {
 	my $this=shift;
 	if (!$this->rmdir_builddir()) {
-		$this->make_first_existing_target(['distclean', 'realclean', 'clean'], @_);
+		$this->make_first_existing_target(['maintainer-clean', 'distclean', 'realclean', 'clean'], @_);
 	}
 }

#1132823#10
Date:
2026-06-07 10:31:55 UTC
From:
To:
Nicolas Boulenguez:

Hi Nicolas,

Thanks for the patch.

I am not opposed to the idea in general and it would combine with
https://bugs.debian.org/924052. However, I have shied away from these
changes because it affects every autotools package all at once.

So either it becomes guarded behind a compat bump or we need a
rebuild-test to see what the damage is. I do not have the capacity to
deal with a rebuild-test and the follow-up, so if this part is left for
me, then I will consider this for a new compat bump down the line.

Best regards,
Niels

#1132823#15
Date:
2026-06-07 13:26:13 UTC
From:
To:
You are right.
The issue is quite minor and a trivial override can work around it, so
there is no need to break random packages before a new compat.
Thanks.