public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: binutils@sourceware.org
Subject: [PATCH 3/3] bfd: merge doc subdir up a level
Date: Mon, 20 Dec 2021 02:16:25 -0500	[thread overview]
Message-ID: <20211220071625.29229-3-vapier@gentoo.org> (raw)
In-Reply-To: <20211220071625.29229-1-vapier@gentoo.org>

This avoids a recursive make into the doc subdir and speeds up the
build slightly.  It also allows for more parallelism
---
 bfd/Makefile.am     |  22 +-
 bfd/Makefile.in     | 530 ++++++++++++++++++++++---
 bfd/configure       |   4 +-
 bfd/configure.ac    |   3 +-
 bfd/doc/Makefile.am | 141 -------
 bfd/doc/Makefile.in | 943 --------------------------------------------
 bfd/doc/local.mk    | 155 ++++++++
 7 files changed, 644 insertions(+), 1154 deletions(-)
 delete mode 100644 bfd/doc/Makefile.am
 delete mode 100644 bfd/doc/Makefile.in
 create mode 100644 bfd/doc/local.mk

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 4960cb500b18..ffe9eed55337 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -17,13 +17,18 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-AUTOMAKE_OPTIONS = no-dist foreign
+AUTOMAKE_OPTIONS = no-dist foreign info-in-builddir no-texinfo.tex
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
+MOSTLYCLEANFILES =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+
 INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 
-SUBDIRS = doc po
+SUBDIRS = po
 
 bfddocdir = doc
 
@@ -920,11 +925,6 @@ LIBBFD_H_FILES = libbfd-in.h libbfd.c bfdio.c bfdwin.c \
 	cache.c reloc.c archures.c linker.c
 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
 
-MKDOC = doc/chew$(EXEEXT_FOR_BUILD)
-
-$(MKDOC):
-	cd $(bfddocdir) && $(MAKE) chew$(EXEEXT_FOR_BUILD)
-
 headers: stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
 # We only rebuild the header files automatically if we have been
@@ -967,12 +967,12 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
 	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 	$(AM_V_at)touch stmp-lcoff-h
 
-MOSTLYCLEANFILES = ofiles stamp-ofiles
+MOSTLYCLEANFILES += ofiles stamp-ofiles
 
-CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
+CLEANFILES += bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
 	stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
-DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
+DISTCLEANFILES += $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
 
 bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
 	$(AM_V_GEN)\
@@ -1009,3 +1009,5 @@ coff-tic54x.lo: coff-tic54x.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $< $(NO_WERROR)
+
+include doc/local.mk
diff --git a/bfd/configure.ac b/bfd/configure.ac
index a578c3a019e5..09dbe40ccb7e 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -1104,8 +1104,7 @@ case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
   true+yes )  AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;;
 esac
 
-rm -f doc/config.status
-AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in])
+AC_CONFIG_FILES([Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in])
 
 dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of
 dnl our two separate POTFILES.  Yuck.
diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am
deleted file mode 100644
index 473e9e6fc71f..000000000000
--- a/bfd/doc/Makefile.am
+++ /dev/null
@@ -1,141 +0,0 @@
-## Process this file with automake to generate Makefile.in
-#
-#   Copyright (C) 2012-2021 Free Software Foundation, Inc.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-#
-
-AUTOMAKE_OPTIONS = info-in-builddir no-texinfo.tex foreign
-
-DOCFILES = aoutx.texi  archive.texi archures.texi \
-	bfdt.texi  cache.texi coffcode.texi \
-	corefile.texi elf.texi elfcode.texi  format.texi \
-	libbfd.texi bfdwin.texi bfdio.texi \
-	opncls.texi  reloc.texi  section.texi  \
-	syms.texi  targets.texi init.texi hash.texi linker.texi \
-	mmo.texi \
-	bfdver.texi
-
-# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction 
-# between VPATH and suffix rules.  If you use GNU Make, perhaps other Makes,
-# you don't need these three:
-SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)/../archive.c \
-	$(srcdir)/../archures.c $(srcdir)/../bfd.c \
-	$(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
-	$(srcdir)/../cache.c $(srcdir)/../coffcode.h \
-	$(srcdir)/../corefile.c $(srcdir)/../elf.c \
-	$(srcdir)/../elfcode.h  $(srcdir)/../format.c \
-	$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
-	$(srcdir)/../reloc.c  $(srcdir)/../section.c \
-	$(srcdir)/../syms.c  $(srcdir)/../targets.c \
-	$(srcdir)/../hash.c $(srcdir)/../linker.c \
-	$(srcdir)/../mmo.c
-
-SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
-	$(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
-	$(srcdir)/../format.c $(srcdir)/../libbfd.c \
-	$(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
-	$(srcdir)/../opncls.c $(srcdir)/../reloc.c \
-	$(srcdir)/../section.c $(srcdir)/../syms.c \
-	$(srcdir)/../targets.c $(srcdir)/../init.c
-
-SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
-	$(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \
-	$(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \
-	$(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \
-	$(srcdir)/../init.c
-
-TEXIDIR = $(srcdir)/../../texinfo/fsf
-
-info_TEXINFOS = bfd.texi
-bfd_TEXINFOS = $(DOCFILES) bfdsumm.texi
-
-AM_MAKEINFOFLAGS = --no-split
-
-MKDOC = chew$(EXEEXT_FOR_BUILD)
-
-AM_CPPFLAGS = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \
-	-I$(srcdir)/../../intl -I../../intl
-
-$(MKDOC): chew.stamp ; @true
-chew.stamp: $(srcdir)/chew.c
-	$(CC_FOR_BUILD) -o chw$$$$$(EXEEXT_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
-	  $(LDFLAGS_FOR_BUILD) $(H_CFLAGS) $(AM_CPPFLAGS) $(srcdir)/chew.c; \
-	$(SHELL) $(srcdir)/../../move-if-change \
-	  chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC); \
-	touch $@
-
-# We can't replace these rules with an implicit rule, because
-# makes without VPATH support couldn't find the .h files in `..'.
-
-# We do not depend on chew directly so that we can distribute the info
-# files, and permit people to rebuild them, without requiring the makeinfo
-# program.  If somebody tries to rebuild info, but none of the .texi files
-# have changed, then nothing will be rebuilt.
-
-REGEN_TEXI = \
-	( \
-	set -e; \
-	./$(MKDOC) -f $(srcdir)/doc.str < $< > $@.tmp; \
-	texi=$@; \
-	texi=$${texi%.stamp}.texi; \
-	test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi .; \
-	$(SHELL) $(srcdir)/../../move-if-change $@.tmp $$texi; \
-	touch $@; \
-	)
-
-%.texi: %.stamp ; @true
-%.stamp: $(srcdir)/../%.h $(srcdir)/doc.str $(MKDOC)
-	$(AM_V_GEN)$(REGEN_TEXI)
-%.stamp: $(srcdir)/../%.c $(srcdir)/doc.str $(MKDOC)
-	$(AM_V_GEN)$(REGEN_TEXI)
-
-# Avoid the %.stamp generating a builddir/bfd.texi that overrides the srcdir/.
-bfd.stamp: ; @touch $@
-
-# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
-# bfd.texi on an 8.3 filesystem.
-bfdt.stamp: $(srcdir)/../bfd.c $(srcdir)/doc.str $(MKDOC)
-	$(AM_V_GEN)$(REGEN_TEXI)
-
-bfdver.texi: $(srcdir)/Makefile.in
-	@echo "creating $@"; \
-	echo "@set VERSION $(VERSION)" > bfdver.texi; \
-	if test -n "$(PKGVERSION)"; then \
-	  echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \
-	fi; \
-	echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \
-	if test -n "$(REPORT_BUGS_TEXI)"; then \
-	  echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \
-	fi
-
-noinst_TEXINFOS = bfdint.texi
-
-MOSTLYCLEANFILES = $(MKDOC) *.o *.stamp
-
-DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
-
-MAINTAINERCLEANFILES = $(DOCFILES)
-
-# We want install to imply install-info as per GNU standards, despite the
-# cygnus option.
-install: install-info
-
-html-local: bfd/index.html
-bfd/index.html: bfd.texi $(bfd_TEXINFOS)
-	$(AM_V_at)$(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
-	  --split=node -I$(srcdir) $(srcdir)/bfd.texi
-
-MAINTAINERCLEANFILES += bfd.info
diff --git a/bfd/doc/local.mk b/bfd/doc/local.mk
new file mode 100644
index 000000000000..3b5c8d37d0f2
--- /dev/null
+++ b/bfd/doc/local.mk
@@ -0,0 +1,155 @@
+## Process this file with automake to generate Makefile.in
+#
+#   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+#
+
+DOCFILES = \
+	%D%/aoutx.texi \
+	%D%/archive.texi \
+	%D%/archures.texi \
+	%D%/bfdio.texi \
+	%D%/bfdt.texi \
+	%D%/bfdver.texi \
+	%D%/bfdwin.texi \
+	%D%/cache.texi \
+	%D%/coffcode.texi \
+	%D%/corefile.texi \
+	%D%/elfcode.texi \
+	%D%/elf.texi \
+	%D%/format.texi \
+	%D%/hash.texi \
+	%D%/init.texi \
+	%D%/libbfd.texi \
+	%D%/linker.texi \
+	%D%/mmo.texi \
+	%D%/opncls.texi \
+	%D%/reloc.texi \
+	%D%/section.texi \
+	%D%/syms.texi \
+	%D%/targets.texi
+
+# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction
+# between VPATH and suffix rules.  If you use GNU Make, perhaps other Makes,
+# you don't need these three:
+SRCDOC = \
+	$(srcdir)/aoutx.h $(srcdir)/archive.c \
+	$(srcdir)/archures.c $(srcdir)/bfd.c \
+	$(srcdir)/bfdio.c $(srcdir)/bfdwin.c \
+	$(srcdir)/cache.c $(srcdir)/coffcode.h \
+	$(srcdir)/corefile.c $(srcdir)/elf.c \
+	$(srcdir)/elfcode.h $(srcdir)/format.c \
+	$(srcdir)/libbfd.c $(srcdir)/opncls.c \
+	$(srcdir)/reloc.c $(srcdir)/section.c \
+	$(srcdir)/syms.c $(srcdir)/targets.c \
+	$(srcdir)/hash.c $(srcdir)/linker.c \
+	$(srcdir)/mmo.c
+
+SRCPROT = $(srcdir)/archive.c $(srcdir)/archures.c \
+	$(srcdir)/bfd.c $(srcdir)/coffcode.h $(srcdir)/corefile.c \
+	$(srcdir)/format.c $(srcdir)/libbfd.c \
+	$(srcdir)/bfdio.c $(srcdir)/bfdwin.c \
+	$(srcdir)/opncls.c $(srcdir)/reloc.c \
+	$(srcdir)/section.c $(srcdir)/syms.c \
+	$(srcdir)/targets.c $(srcdir)/init.c
+
+SRCIPROT = $(srcdir)/cache.c $(srcdir)/libbfd.c \
+	$(srcdir)/bfdio.c $(srcdir)/bfdwin.c \
+	$(srcdir)/reloc.c $(srcdir)/cpu-h8300.c \
+	$(srcdir)/cpu-i960.c $(srcdir)/archures.c \
+	$(srcdir)/init.c
+
+TEXIDIR = $(srcdir)/../texinfo/fsf
+
+info_TEXINFOS = %D%/bfd.texi
+%C%_bfd_TEXINFOS = $(DOCFILES) %D%/bfdsumm.texi
+
+AM_MAKEINFOFLAGS = --no-split
+
+MKDOC = %D%/chew$(EXEEXT_FOR_BUILD)
+
+$(MKDOC): %D%/chew.stamp ; @true
+%D%/chew.stamp: $(srcdir)/%D%/chew.c %D%/$(am__dirstamp)
+	$(AM_V_CCLD)$(CC_FOR_BUILD) -o %D%/chw$$$$$(EXEEXT_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
+	  $(LDFLAGS_FOR_BUILD) $(H_CFLAGS) \
+	  -I. -I$(srcdir) -I%D% -I$(srcdir)/../include -I$(srcdir)/../intl -I../intl \
+	  $(srcdir)/%D%/chew.c && \
+	$(SHELL) $(srcdir)/../move-if-change \
+	  %D%/chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC) && \
+	touch $@
+
+# We can't replace these rules with an implicit rule, because
+# makes without VPATH support couldn't find the .h files in `..'.
+
+# We do not depend on chew directly so that we can distribute the info
+# files, and permit people to rebuild them, without requiring the makeinfo
+# program.  If somebody tries to rebuild info, but none of the .texi files
+# have changed, then nothing will be rebuilt.
+
+REGEN_TEXI = \
+	( \
+	set -e; \
+	$(MKDOC) -f $(srcdir)/%D%/doc.str < $< > $@.tmp; \
+	texi=$@; \
+	texi=$${texi%.stamp}.texi; \
+	test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi .; \
+	$(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
+	touch $@; \
+	)
+
+%D%/%.texi: %D%/%.stamp ; @true
+%D%/%.stamp: $(srcdir)/%.h $(srcdir)/%D%/doc.str $(MKDOC) %D%/$(am__dirstamp)
+	$(AM_V_GEN)$(REGEN_TEXI)
+%D%/%.stamp: $(srcdir)/%.c $(srcdir)/%D%/doc.str $(MKDOC) %D%/$(am__dirstamp)
+	$(AM_V_GEN)$(REGEN_TEXI)
+
+# Avoid the %.stamp generating a builddir/bfd.texi that overrides the srcdir/.
+%D%/bfd.stamp: %D%/$(am__dirstamp) ; @touch $@
+
+# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
+# bfd.texi on an 8.3 filesystem.
+%D%/bfdt.stamp: $(srcdir)/bfd.c $(srcdir)/%D%/doc.str $(MKDOC) %D%/$(am__dirstamp)
+	$(AM_V_GEN)$(REGEN_TEXI)
+
+%D%/bfdver.texi: $(srcdir)/Makefile.in
+	$(AM_V_GEN)\
+	echo "@set VERSION $(VERSION)" > bfdver.texi; \
+	if test -n "$(PKGVERSION)"; then \
+	  echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \
+	fi; \
+	echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \
+	if test -n "$(REPORT_BUGS_TEXI)"; then \
+	  echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \
+	fi
+
+noinst_TEXINFOS = %D%/bfdint.texi
+
+MOSTLYCLEANFILES += $(MKDOC) %D%/*.o %D%/*.stamp
+
+DISTCLEANFILES += %D%/bfd.?? %D%/bfd.??? texput.log
+
+MAINTAINERCLEANFILES += $(DOCFILES)
+
+# We want install to imply install-info as per GNU standards, despite the
+# cygnus option.
+install: install-info
+
+html-local: %D%/bfd/index.html
+%D%/bfd/index.html: %D%/bfd.texi $(bfd_TEXINFOS) %D%/$(am__dirstamp)
+	$(AM_V_at)$(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
+	  --split=node -I$(srcdir) -o %D%/bfd $(srcdir)/bfd.texi
+
+MAINTAINERCLEANFILES += %D%/bfd.info
-- 
2.33.0


  parent reply	other threads:[~2021-12-20  7:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20  7:16 [PATCH 1/3] bfd: replace doc header generation with pattern rules Mike Frysinger
2021-12-20  7:16 ` [PATCH 2/3] bfd: rename core.texi to corefile.texi Mike Frysinger
2022-01-22 14:38   ` Nick Clifton
2021-12-20  7:16 ` Mike Frysinger [this message]
2022-01-22 14:39   ` [PATCH 3/3] bfd: merge doc subdir up a level Nick Clifton
2022-01-23 15:05     ` H.J. Lu
2022-01-23 19:38       ` Mike Frysinger
2022-01-22 14:37 ` [PATCH 1/3] bfd: replace doc header generation with pattern rules Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211220071625.29229-3-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).