[PATCH] gas: merge doc subdir up a level

Mike Frysinger vapier@gentoo.org
Tue Nov 30 02:38:31 GMT 2021


This avoids a recursive make into the doc subdir and speeds up the
build slightly.  It also allows for more parallelism.
---
 gas/Makefile.am     |   8 +-
 gas/Makefile.in     | 571 ++++++++++++++++++++++++--
 gas/configure.ac    |   2 +-
 gas/doc/Makefile.am | 141 -------
 gas/doc/Makefile.in | 977 --------------------------------------------
 gas/doc/local.mk    | 137 +++++++
 6 files changed, 673 insertions(+), 1163 deletions(-)
 delete mode 100644 gas/doc/Makefile.am
 delete mode 100644 gas/doc/Makefile.in
 create mode 100644 gas/doc/local.mk

diff --git a/gas/Makefile.am b/gas/Makefile.am
index 7678ee61144e..80c6e2c28f3a 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -17,10 +17,12 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-AUTOMAKE_OPTIONS = dejagnu foreign no-dist subdir-objects
+AUTOMAKE_OPTIONS = dejagnu foreign no-dist subdir-objects info-in-builddir no-texinfo.tex
 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
 
-SUBDIRS = doc po
+MAINTAINERCLEANFILES =
+
+SUBDIRS = po
 
 tooldir = $(exec_prefix)/$(target_alias)
 
@@ -644,3 +646,5 @@ de-stage3:
 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.tgt $(BFDDIR)/development.sh
 
 EXTRA_DEJAGNU_SITE_CONFIG = development.exp
+
+include doc/local.mk
diff --git a/gas/configure.ac b/gas/configure.ac
index 318811c56e54..f033f974a8ed 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -1037,7 +1037,7 @@ dnl the build directory which include the right .h file.  Make sure
 dnl the old symlinks don't exist, so that a reconfigure in an existing
 dnl directory behaves reasonably.
 
-AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
+AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
 AC_CONFIG_COMMANDS([default],
 [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
  echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am
deleted file mode 100644
index f2c6654e89da..000000000000
diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in
deleted file mode 100644
index 89d2ca067eb4..000000000000
diff --git a/gas/doc/local.mk b/gas/doc/local.mk
new file mode 100644
index 000000000000..7b064700ea64
--- /dev/null
+++ b/gas/doc/local.mk
@@ -0,0 +1,137 @@
+## 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/>.
+#
+
+# What version of the manual you want; "all" includes everything
+CONFIG=all
+
+# Options to extract the man page from as.texi
+MANCONF = -Dman
+
+TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
+
+POD2MAN = pod2man --center="GNU Development Tools" \
+	--release="binutils-$(VERSION)" --section=1
+
+man_MANS = %D%/as.1
+
+info_TEXINFOS = %D%/as.texi
+%C%_as_TEXINFOS = %D%/asconfig.texi $(CPU_DOCS)
+
+AM_MAKEINFOFLAGS = -I "$(srcdir)/%D%" -I %D% -I "$(srcdir)/../libiberty" \
+		   -I "$(srcdir)/../bfd/doc" -I ../bfd/doc \
+		   --no-split
+TEXI2DVI = texi2dvi -I "$(srcdir)/%D%" -I %D% -I "$(srcdir)/../libiberty" \
+		   -I "$(srcdir)/../bfd/doc" -I ../bfd/doc
+
+%D%/asconfig.texi: %D%/$(CONFIG).texi
+	$(AM_V_at)rm -f %D%/asconfig.texi
+	$(AM_V_at)$(MKDIR_P) %D%
+	$(AM_V_GEN)cp $(srcdir)/%D%/$(CONFIG).texi %D%/asconfig.texi
+	$(AM_V_at)chmod u+w %D%/asconfig.texi
+
+CPU_DOCS = \
+	%D%/c-aarch64.texi \
+	%D%/c-alpha.texi \
+	%D%/c-arc.texi \
+	%D%/c-arm.texi \
+	%D%/c-avr.texi \
+	%D%/c-bfin.texi \
+	%D%/c-bpf.texi \
+	%D%/c-cr16.texi \
+	%D%/c-cris.texi \
+	%D%/c-csky.texi \
+	%D%/c-d10v.texi \
+	%D%/c-epiphany.texi \
+	%D%/c-h8300.texi \
+	%D%/c-hppa.texi \
+	%D%/c-i386.texi \
+	%D%/c-ip2k.texi \
+	%D%/c-lm32.texi \
+	%D%/c-m32c.texi \
+	%D%/c-m32r.texi \
+	%D%/c-m68hc11.texi \
+	%D%/c-m68k.texi \
+	%D%/c-s12z.texi \
+	%D%/c-metag.texi \
+	%D%/c-microblaze.texi \
+	%D%/c-mips.texi \
+	%D%/c-mmix.texi \
+	%D%/c-mt.texi \
+	%D%/c-msp430.texi \
+	%D%/c-nios2.texi \
+	%D%/c-nds32.texi \
+	%D%/c-ns32k.texi \
+	%D%/c-or1k.texi \
+	%D%/c-pdp11.texi \
+	%D%/c-pj.texi \
+	%D%/c-ppc.texi \
+	%D%/c-pru.texi \
+	%D%/c-rl78.texi \
+	%D%/c-riscv.texi \
+	%D%/c-rx.texi \
+	%D%/c-s390.texi \
+	%D%/c-score.texi \
+	%D%/c-sh.texi \
+	%D%/c-sparc.texi \
+	%D%/c-tic54x.texi \
+	%D%/c-tic6x.texi \
+	%D%/c-tilegx.texi \
+	%D%/c-tilepro.texi \
+	%D%/c-v850.texi \
+	%D%/c-vax.texi \
+	%D%/c-visium.texi \
+	%D%/c-xgate.texi \
+	%D%/c-xstormy16.texi \
+	%D%/c-xtensa.texi \
+	%D%/c-z80.texi \
+	%D%/c-z8k.texi
+
+# We want install to imply install-info as per GNU standards, despite the
+# cygnus option.
+install-data-local: install-info
+
+# This one isn't ready for prime time yet.  Not even a little bit.
+
+noinst_TEXINFOS = %D%/internals.texi
+
+MAINTAINERCLEANFILES += %D%/asconfig.texi
+
+# Maintenance
+
+# We need it for the taz target in ../Makefile.in.
+info-local: $(MANS)
+
+# Build the man page from the texinfo file
+# The sed command removes the no-adjust Nroff command so that
+# the man output looks standard.
+%D%/as.1: $(srcdir)/%D%/as.texi %D%/asconfig.texi $(CPU_DOCS)
+	$(AM_V_GEN)touch $@
+	$(AM_V_at)-$(TEXI2POD) $(MANCONF) < $(srcdir)/%D%/as.texi > %D%/as.pod
+	$(AM_V_at)-($(POD2MAN) %D%/as.pod | \
+	        sed -e '/^.if n .na/d' > $@.T$$$$ && \
+	        mv -f $@.T$$$$ $@) || \
+	        (rm -f $@.T$$$$ && exit 1)
+	$(AM_V_at)rm -f %D%/as.pod
+
+html-local: %D%/as/index.html
+%D%/as/index.html: %D%/as.texi $(as_TEXINFOS)
+	$(AM_V_GEN)$(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
+	  --split=node -I$(srcdir)/%D% -o %D%/as $(srcdir)/%D%/as.texi
+
+MAINTAINERCLEANFILES += %D%/as.info
-- 
2.33.0



More information about the Binutils mailing list