The GNU Coding Standards say [1] that

  "If you have unpacked the source and built the program without creating
   any other files, ‘make distclean’ should leave only the files that were
   in the distribution."

In case of groff, the tarball contains
  doc/groff.dvi
  doc/groff.info-1
  doc/groff.info-2
  doc/groff.info-3
but these files get erased by "make distclean".

How to reproduce:

$ tar xf .../groff-1.25.0.rc2.tar.gz
$ cd groff-1.25.0.rc2
$ ./configure && make
$ ls -1 doc/groff.dvi doc/groff.info*
doc/groff.dvi
doc/groff.info
doc/groff.info-1
doc/groff.info-2
doc/groff.info-3
$ make distclean
$ ls -1 doc/groff.dvi doc/groff.info*
ls: cannot access 'doc/groff.dvi': No such file or directory
doc/groff.info

The attached patch fixes it. So that these files get erased by
"make maintainer-clean", not "make distclean".

[1] https://www.gnu.org/prep/standards/html_node/Standard-Targets.html

>From c59fa9383baca4317294427c9891014e49b8cda6 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Wed, 5 Aug 2026 19:32:49 +0200
Subject: [PATCH] build: Fix "make distclean".

* doc/doc.am (mostlyclean_doc): Don't erase groff.dvi and groff.info-*.
(MAINTAINERCLEANFILES): Add groff.dvi and groff.info-*.
---
 doc/doc.am | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/doc.am b/doc/doc.am
index 2418b4731..33290d229 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -458,8 +458,7 @@ DOC_LL=line-layout
 # {gnu,line-layout}.{eps,png} only from an out-of-source build tree.
 mostlyclean-local: mostlyclean_doc
 mostlyclean_doc:
-	$(RM) $(GROFF_DVI) $(PROCESSEDDOCFILES_PDF)
-	$(RM) doc/groff.info-*
+	$(RM) $(PROCESSEDDOCFILES_PDF)
 	if test $(top_builddir) != $(top_srcdir); then \
 	  $(RM) $(top_builddir)/doc/groff.css \
 	    $(GROFF_HTML) $(GROFF_INFO) $(GROFF_PDF) $(GROFF_TXT) \
@@ -675,7 +674,7 @@ doc/groff.texi: $(top_srcdir)/doc/groff.texi.in
 	&& $(DOC_SED) $(top_srcdir)/doc/groff.texi.in >$@
 
 EXTRA_DIST += doc/groff.info
-MAINTAINERCLEANFILES += doc/groff.info
+MAINTAINERCLEANFILES += doc/groff.info doc/groff.info-*
 if HAVE_MAKEINFO
 $(GROFF_INFO): doc/groff.texi
 	$(AM_V_at)$(MKDIR_P) $(doc_builddir)
@@ -722,6 +721,7 @@ MAINTAINERCLEANFILES += $(GROFF_HTML) $(GROFF_HTML).node
 	  -o $@ $<
 
 EXTRA_DIST += doc/groff.dvi doc/groff.pdf
+MAINTAINERCLEANFILES += doc/groff.dvi
 
 # Define suffix rules to make our Texinfo manual in DVI and PDF
 # formats.  'pdf' and 'dvi' and their installation counterparts
-- 
2.53.0

Reply via email to