binutils: doc: move back binutils.info to MAINTAINERCLEANFILES

Message ID 20200306162556.14085-1-simon.marchi@efficios.com
State New
Headers show
Series
  • binutils: doc: move back binutils.info to MAINTAINERCLEANFILES
Related show

Commit Message

Simon Marchi March 6, 2020, 4:25 p.m.
In commit 2b44a6a237 (" binutils: doc: make `make clean` clean more
things"), I moved binutils.info to the MOSTLYCLEANFILES, which made it
get removed by "make clean".

Because generating binutils.info requires makeinfo, and we do not want
to require makeinfo when building from the tarball, binutils.info should
not get removed by "make clean" (otherwise, it won't be included in the
tarball).

This patch puts it back in MAINTAINERCLEANFILES, so that it only gets
cleaned if you use "make maintainer-clean".

Tested by building a source release and confirming that binutils.info is
present.

binutils/ChangeLog:

	PR 25491
	* doc/Makefile.am: Move binutils.info to MAINTAINERCLEANFILES.
	* doc/Makefile.in: Re-generate.
---
 binutils/doc/Makefile.am | 4 +++-
 binutils/doc/Makefile.in | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.25.1

Comments

Alan Modra March 6, 2020, 11:19 p.m. | #1
On Fri, Mar 06, 2020 at 11:25:56AM -0500, Simon Marchi wrote:
> In commit 2b44a6a237 (" binutils: doc: make `make clean` clean more

> things"), I moved binutils.info to the MOSTLYCLEANFILES, which made it

> get removed by "make clean".

> 

> Because generating binutils.info requires makeinfo, and we do not want

> to require makeinfo when building from the tarball, binutils.info should

> not get removed by "make clean" (otherwise, it won't be included in the

> tarball).

> 

> This patch puts it back in MAINTAINERCLEANFILES, so that it only gets

> cleaned if you use "make maintainer-clean".

> 

> Tested by building a source release and confirming that binutils.info is

> present.


It's not just binutils.info but also all the .1 files.  I think you
should move $(man_MANS) to MAINTAINERCLEANFILES too.  src-release.sh
does a "make distclean" when preparings sources for a tar file.

> binutils/ChangeLog:

> 

> 	PR 25491

> 	* doc/Makefile.am: Move binutils.info to MAINTAINERCLEANFILES.

> 	* doc/Makefile.in: Re-generate.


OK with man_MANS moved too.

-- 
Alan Modra
Australia Development Lab, IBM
Simon Marchi March 6, 2020, 11:27 p.m. | #2
On 2020-03-06 6:19 p.m., Alan Modra wrote:
> On Fri, Mar 06, 2020 at 11:25:56AM -0500, Simon Marchi wrote:

>> In commit 2b44a6a237 (" binutils: doc: make `make clean` clean more

>> things"), I moved binutils.info to the MOSTLYCLEANFILES, which made it

>> get removed by "make clean".

>>

>> Because generating binutils.info requires makeinfo, and we do not want

>> to require makeinfo when building from the tarball, binutils.info should

>> not get removed by "make clean" (otherwise, it won't be included in the

>> tarball).

>>

>> This patch puts it back in MAINTAINERCLEANFILES, so that it only gets

>> cleaned if you use "make maintainer-clean".

>>

>> Tested by building a source release and confirming that binutils.info is

>> present.

> 

> It's not just binutils.info but also all the .1 files.  I think you

> should move $(man_MANS) to MAINTAINERCLEANFILES too.  src-release.sh

> does a "make distclean" when preparings sources for a tar file.


Even though the .1 files don't require texinfo to be built?  As far as I
can see, they only require perl, which I presume we can assume is available.

> 

>> binutils/ChangeLog:

>>

>> 	PR 25491

>> 	* doc/Makefile.am: Move binutils.info to MAINTAINERCLEANFILES.

>> 	* doc/Makefile.in: Re-generate.

> 

> OK with man_MANS moved too.


And cxxfilt.man too I presume?

Simon
Alan Modra March 7, 2020, 1:48 a.m. | #3
On Fri, Mar 06, 2020 at 06:27:51PM -0500, Simon Marchi wrote:
> On 2020-03-06 6:19 p.m., Alan Modra wrote:

> > On Fri, Mar 06, 2020 at 11:25:56AM -0500, Simon Marchi wrote:

> >> In commit 2b44a6a237 (" binutils: doc: make `make clean` clean more

> >> things"), I moved binutils.info to the MOSTLYCLEANFILES, which made it

> >> get removed by "make clean".

> >>

> >> Because generating binutils.info requires makeinfo, and we do not want

> >> to require makeinfo when building from the tarball, binutils.info should

> >> not get removed by "make clean" (otherwise, it won't be included in the

> >> tarball).

> >>

> >> This patch puts it back in MAINTAINERCLEANFILES, so that it only gets

> >> cleaned if you use "make maintainer-clean".

> >>

> >> Tested by building a source release and confirming that binutils.info is

> >> present.

> > 

> > It's not just binutils.info but also all the .1 files.  I think you

> > should move $(man_MANS) to MAINTAINERCLEANFILES too.  src-release.sh

> > does a "make distclean" when preparings sources for a tar file.

> 

> Even though the .1 files don't require texinfo to be built?  As far as I

> can see, they only require perl, which I presume we can assume is available.


I'm going by what used to be distributed, and the fact that
ld/Makefile.am has ld.1 in MAINTAINERCLEANFILES and
gas/doc/Makefile.am doesn't mention as.1 in any clean rule.  You are
correct that they only require perl, but there isn't a good reason to
make binutils/doc different from other directories.

> > 

> >> binutils/ChangeLog:

> >>

> >> 	PR 25491

> >> 	* doc/Makefile.am: Move binutils.info to MAINTAINERCLEANFILES.

> >> 	* doc/Makefile.in: Re-generate.

> > 

> > OK with man_MANS moved too.

> 

> And cxxfilt.man too I presume?


That one is an intermediary, but yes, it looks like the way the
makefile is written that too should be distributed along with .1
files.

-- 
Alan Modra
Australia Development Lab, IBM
Simon Marchi March 7, 2020, 3:09 a.m. | #4
On 2020-03-06 8:48 p.m., Alan Modra wrote:
>> Even though the .1 files don't require texinfo to be built?  As far as I

>> can see, they only require perl, which I presume we can assume is available.

> 

> I'm going by what used to be distributed, and the fact that

> ld/Makefile.am has ld.1 in MAINTAINERCLEANFILES and

> gas/doc/Makefile.am doesn't mention as.1 in any clean rule.  You are

> correct that they only require perl, but there isn't a good reason to

> make binutils/doc different from other directories.


Ok, makes sense.

>>>> binutils/ChangeLog:

>>>>

>>>> 	PR 25491

>>>> 	* doc/Makefile.am: Move binutils.info to MAINTAINERCLEANFILES.

>>>> 	* doc/Makefile.in: Re-generate.

>>>

>>> OK with man_MANS moved too.

>>

>> And cxxfilt.man too I presume?

> 

> That one is an intermediary, but yes, it looks like the way the

> makefile is written that too should be distributed along with .1

> files.


Ok, so I essentially renamed MOSTLYCLEANFILES to MAINTAINERCLEANFILES.  I pushed
the patch as below.


From 9979ab666354f355da46ba826a3efeef9fbb8b24 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@efficios.com>

Date: Fri, 6 Mar 2020 22:06:34 -0500
Subject: [PATCH] binutils: doc: move artifacts back to MAINTAINERCLEANFILES

In commit 2b44a6a237 (" binutils: doc: make `make clean` clean more
things"), I moved the doc build artifacts to MOSTLYCLEANFILES, which
made them get removed by "make clean".

Because generating binutils.info requires makeinfo, and we do not want
to require makeinfo when building from the tarball, binutils.info should
not get removed by "make clean" (otherwise, it won't be included in the
tarball).

And to be consistent with other projects (e.g. ld and gas), we also want
to ship the built man pages in the tarball.

This patch puts back all these in MAINTAINERCLEANFILES, so that they are
bundled in the tarball, and only cleaned if you use "make
maintainer-clean".

Tested by building a source release and confirming they are present.

binutils/ChangeLog:

	PR 25491
	* doc/Makefile.am: Rename MOSTLYCLEANFILES to MAINTAINERCLEANFILES.
	* doc/Makefile.in: Re-generate.
---
 binutils/ChangeLog       | 6 ++++++
 binutils/doc/Makefile.am | 2 +-
 binutils/doc/Makefile.in | 4 ++--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 840fc4d5891e..2db388daf473 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-06  Simon Marchi  <simon.marchi@efficios.com>
+
+	PR 25491
+	* doc/Makefile.am: Rename MOSTLYCLEANFILES to MAINTAINERCLEANFILES.
+	* doc/Makefile.in: Re-generate.
+
 2020-03-06  Nick Clifton  <nickc@redhat.com>

 	* objcopy.c (check_new_section_flags): New function.  Reject the
diff --git a/binutils/doc/Makefile.am b/binutils/doc/Makefile.am
index a1e07ec246e7..af6370a23a8a 100644
--- a/binutils/doc/Makefile.am
+++ b/binutils/doc/Makefile.am
@@ -162,7 +162,7 @@ cxxfilt.man:	$(binutils_TEXI)
 		mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
 	rm -f $(DEMANGLER_NAME).pod

-MOSTLYCLEANFILES     = $(man_MANS) binutils.info cxxfilt.man
+MAINTAINERCLEANFILES = $(man_MANS) binutils.info cxxfilt.man

 $(DEMANGLER_NAME).1: cxxfilt.man Makefile
 	if test -f cxxfilt.man; then \
diff --git a/binutils/doc/Makefile.in b/binutils/doc/Makefile.in
index b0e7b7b6c896..b00260bc25f8 100644
--- a/binutils/doc/Makefile.in
+++ b/binutils/doc/Makefile.in
@@ -429,7 +429,7 @@ AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \
 TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \
 		    -I "$(top_srcdir)/../bfd/doc" -I ../../bfd/doc

-MOSTLYCLEANFILES = $(man_MANS) binutils.info cxxfilt.man
+MAINTAINERCLEANFILES = $(man_MANS) binutils.info cxxfilt.man
 all: all-am

 .SUFFIXES:
@@ -712,7 +712,6 @@ install-strip:
 	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
 	fi
 mostlyclean-generic:
-	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)

 clean-generic:

@@ -723,6 +722,7 @@ distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-am

 clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am
-- 
2.25.1

Patch

diff --git a/binutils/doc/Makefile.am b/binutils/doc/Makefile.am
index a1e07ec246..2f93d4588e 100644
--- a/binutils/doc/Makefile.am
+++ b/binutils/doc/Makefile.am
@@ -162,7 +162,9 @@  cxxfilt.man:	$(binutils_TEXI)
 		mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
 	rm -f $(DEMANGLER_NAME).pod
 
-MOSTLYCLEANFILES     = $(man_MANS) binutils.info cxxfilt.man
+MOSTLYCLEANFILES = $(man_MANS) cxxfilt.man
+
+MAINTAINERCLEANFILES = binutils.info
 
 $(DEMANGLER_NAME).1: cxxfilt.man Makefile
 	if test -f cxxfilt.man; then \
diff --git a/binutils/doc/Makefile.in b/binutils/doc/Makefile.in
index b0e7b7b6c8..a02b9633bf 100644
--- a/binutils/doc/Makefile.in
+++ b/binutils/doc/Makefile.in
@@ -429,7 +429,8 @@  AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \
 TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \
 		    -I "$(top_srcdir)/../bfd/doc" -I ../../bfd/doc
 
-MOSTLYCLEANFILES = $(man_MANS) binutils.info cxxfilt.man
+MOSTLYCLEANFILES = $(man_MANS) cxxfilt.man
+MAINTAINERCLEANFILES = binutils.info
 all: all-am
 
 .SUFFIXES:
@@ -723,6 +724,7 @@  distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-am
 
 clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am