From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E147E3858400 for ; Mon, 20 Dec 2021 07:16:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E147E3858400 Received: by smtp.gentoo.org (Postfix, from userid 559) id 56349343128; Mon, 20 Dec 2021 07:16:19 +0000 (UTC) From: Mike Frysinger To: binutils@sourceware.org Subject: [PATCH 3/3] bfd: merge doc subdir up a level Date: Mon, 20 Dec 2021 02:16:25 -0500 Message-Id: <20211220071625.29229-3-vapier@gentoo.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211220071625.29229-1-vapier@gentoo.org> References: <20211220071625.29229-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2021 07:16:23 -0000 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 @@ # . # -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 -# . -# - -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 +# . +# + +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