]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/Makefile.am
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / bfd / Makefile.am
index 8ffdbb12e08159e643ed7265466bd0033b779aa1..b6088a3c4a86048b4d0ad37c49bbf7c515f1f36a 100644 (file)
@@ -1,23 +1,23 @@
 ## Process this file with automake to generate Makefile.in
 #
-#   Copyright (C) 2012-2015 Free Software Foundation, Inc.
+#   Copyright (C) 2012-2020 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 = 1.11 no-dist foreign
+AUTOMAKE_OPTIONS = no-dist foreign
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
 INCDIR = $(srcdir)/../include
@@ -32,7 +32,8 @@ if INSTALL_LIBBFD
 bfdlibdir = @bfdlibdir@
 bfdincludedir = @bfdincludedir@
 bfdlib_LTLIBRARIES = libbfd.la
-bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
+bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
+                    bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
 else !INSTALL_LIBBFD
 # Empty these so that the respective installation directories will not be created.
 bfdlibdir =
@@ -43,10 +44,16 @@ noinst_LTLIBRARIES = libbfd.la
 libbfd_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
 endif
 
+# This is where we get zlib from.  zlibdir is -L../zlib and zlibinc is
+# -I../zlib, unless we were configured with --with-system-zlib, in which
+# case both are empty.
+ZLIB = @zlibdir@ -lz
+ZLIBINC = @zlibinc@
+
 WARN_CFLAGS = @WARN_CFLAGS@
 NO_WERROR = @NO_WERROR@
-AM_CFLAGS = $(WARN_CFLAGS)
-AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
+AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC)
+AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DLIBDIR='"$(libdir)"'
 if PLUGINS
 bfdinclude_HEADERS += $(INCDIR)/plugin-api.h
 LIBDL = @lt_cv_dlopen_libs@
@@ -63,17 +70,17 @@ BFD_H = bfd.h
 # need two copies of the executable, one to download and one for the
 # debugger).
 BFD32_LIBS = \
-       archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
-       cache.lo coff-bfd.lo compress.lo corefile.lo format.lo hash.lo \
-       init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo \
+       archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo \
+       coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo \
+       hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo \
        section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo \
        binary.lo ihex.lo srec.lo tekhex.lo verilog.lo
 
 BFD64_LIBS = archive64.lo
 
 BFD32_LIBS_CFILES = \
-       archive.c archures.c bfd.c bfdio.c bfdwin.c \
-       cache.c coff-bfd.c compress.c corefile.c format.c hash.c \
+       archive.c archures.c bfd.c bfdio.c bfdwin.c cache.c coff-bfd.c \
+       compress.c corefile.c elf-properties.c format.c hash.c \
        init.c libbfd.c linker.c merge.c opncls.c reloc.c \
        section.c simple.c stab-syms.c stabs.c syms.c targets.c \
        binary.c ihex.c srec.c tekhex.c verilog.c
@@ -89,25 +96,24 @@ ALL_MACHINES = \
        cpu-arm.lo \
        cpu-avr.lo \
        cpu-bfin.lo \
+       cpu-bpf.lo \
        cpu-cr16.lo \
-       cpu-cr16c.lo \
        cpu-cris.lo \
        cpu-crx.lo \
+       cpu-csky.lo \
        cpu-d10v.lo \
        cpu-d30v.lo \
        cpu-dlx.lo \
        cpu-epiphany.lo \
        cpu-fr30.lo \
        cpu-frv.lo \
+       cpu-ft32.lo \
        cpu-h8300.lo \
-       cpu-h8500.lo \
        cpu-hppa.lo \
-       cpu-i370.lo \
        cpu-i386.lo \
+       cpu-iamcu.lo \
        cpu-l1om.lo \
        cpu-k1om.lo \
-       cpu-i860.lo \
-       cpu-i960.lo \
        cpu-ia64.lo \
        cpu-ip2k.lo \
        cpu-iq2000.lo \
@@ -119,9 +125,9 @@ ALL_MACHINES = \
        cpu-m68hc11.lo \
        cpu-m68hc12.lo \
        cpu-m9s12x.lo \
+       cpu-s12z.lo \
        cpu-m9s12xg.lo \
        cpu-m68k.lo \
-       cpu-m88k.lo \
        cpu-mcore.lo \
        cpu-mep.lo \
        cpu-metag.lo \
@@ -132,14 +138,16 @@ ALL_MACHINES = \
        cpu-msp430.lo \
        cpu-mt.lo \
        cpu-nds32.lo \
+       cpu-nfp.lo \
        cpu-nios2.lo \
        cpu-ns32k.lo \
        cpu-or1k.lo \
        cpu-pdp11.lo \
        cpu-pj.lo \
-       cpu-plugin.lo \
        cpu-powerpc.lo \
+       cpu-pru.lo \
        cpu-rs6000.lo \
+       cpu-riscv.lo \
        cpu-rl78.lo \
        cpu-rx.lo \
        cpu-s390.lo \
@@ -151,15 +159,13 @@ ALL_MACHINES = \
        cpu-tic4x.lo \
        cpu-tic54x.lo \
        cpu-tic6x.lo \
-       cpu-tic80.lo \
        cpu-tilegx.lo \
        cpu-tilepro.lo \
        cpu-v850.lo \
        cpu-v850_rh850.lo \
        cpu-vax.lo \
        cpu-visium.lo \
-       cpu-w65.lo \
-       cpu-we32k.lo \
+       cpu-wasm32.lo \
        cpu-xc16x.lo \
        cpu-xgate.lo \
        cpu-xstormy16.lo \
@@ -174,25 +180,24 @@ ALL_MACHINES_CFILES = \
        cpu-arm.c \
        cpu-avr.c \
        cpu-bfin.c \
+       cpu-bpf.c \
        cpu-cr16.c \
-       cpu-cr16c.c \
        cpu-cris.c \
        cpu-crx.c \
+       cpu-csky.c \
        cpu-d10v.c \
        cpu-d30v.c \
        cpu-dlx.c \
        cpu-epiphany.c \
        cpu-fr30.c \
        cpu-frv.c \
+       cpu-ft32.c \
        cpu-h8300.c \
-       cpu-h8500.c \
        cpu-hppa.c \
-       cpu-i370.c \
        cpu-i386.c \
+       cpu-iamcu.c \
        cpu-l1om.c \
        cpu-k1om.c \
-       cpu-i860.c \
-       cpu-i960.c \
        cpu-ia64.c \
        cpu-ip2k.c \
        cpu-iq2000.c \
@@ -204,9 +209,9 @@ ALL_MACHINES_CFILES = \
        cpu-m68hc11.c \
        cpu-m68hc12.c \
        cpu-m9s12x.c \
+       cpu-s12z.c \
        cpu-m9s12xg.c \
        cpu-m68k.c \
-       cpu-m88k.c \
        cpu-mcore.c \
        cpu-mep.c \
        cpu-metag.c \
@@ -217,14 +222,16 @@ ALL_MACHINES_CFILES = \
        cpu-msp430.c \
        cpu-mt.c \
        cpu-nds32.c \
+       cpu-nfp.c \
        cpu-ns32k.c \
        cpu-nios2.c \
        cpu-or1k.c \
        cpu-pdp11.c \
        cpu-pj.c \
-       cpu-plugin.c \
        cpu-powerpc.c \
+       cpu-pru.c \
        cpu-rs6000.c \
+       cpu-riscv.c \
        cpu-rl78.c \
        cpu-rx.c \
        cpu-s390.c \
@@ -236,15 +243,13 @@ ALL_MACHINES_CFILES = \
        cpu-tic4x.c \
        cpu-tic54x.c \
        cpu-tic6x.c \
-       cpu-tic80.c \
        cpu-tilegx.c \
        cpu-tilepro.c \
        cpu-v850.c \
        cpu-v850_rh850.c \
        cpu-vax.c \
        cpu-visium.c \
-       cpu-w65.c \
-       cpu-we32k.c \
+       cpu-wasm32.c \
        cpu-xc16x.c \
        cpu-xgate.c \
        cpu-xstormy16.c \
@@ -255,42 +260,20 @@ ALL_MACHINES_CFILES = \
 # The .o files needed by all of the 32 bit vectors that are configured into
 # target_vector in targets.c if configured with --enable-targets=all.
 BFD32_BACKENDS = \
-       aout-adobe.lo \
-       aout-arm.lo \
        aout-cris.lo \
        aout-ns32k.lo \
-       aout-sparcle.lo \
        aout-tic30.lo \
-       aout0.lo \
        aout32.lo \
-       armnetbsd.lo \
-       bout.lo \
        cf-i386lynx.lo \
-       cf-sparclynx.lo \
-       coff-apollo.lo \
-       coff-arm.lo \
-       coff-aux.lo \
        coff-go32.lo \
-       coff-h8300.lo \
-       coff-h8500.lo \
        coff-i386.lo \
-       coff-i860.lo \
-       coff-i960.lo \
-       coff-m68k.lo \
-       coff-m88k.lo \
        coff-mips.lo \
        coff-rs6000.lo \
        coff-sh.lo \
-       coff-sparc.lo \
        coff-stgo32.lo \
-       coff-svm68k.lo \
        coff-tic30.lo \
        coff-tic4x.lo \
        coff-tic54x.lo \
-       coff-tic80.lo \
-       coff-u68k.lo \
-       coff-w65.lo \
-       coff-we32k.lo \
        coff-z80.lo \
        coff-z8k.lo \
        coffgen.lo \
@@ -314,22 +297,21 @@ BFD32_BACKENDS = \
        elf32-avr.lo \
        elf32-bfin.lo \
        elf32-cr16.lo \
-       elf32-cr16c.lo \
        elf32-cris.lo \
        elf32-crx.lo \
+       elf32-csky.lo \
        elf32-d10v.lo \
        elf32-d30v.lo \
        elf32-dlx.lo \
        elf32-epiphany.lo \
        elf32-fr30.lo \
        elf32-frv.lo \
+       elf32-ft32.lo \
        elf32-gen.lo \
        elf32-h8300.lo \
        elf32-hppa.lo \
-       elf32-i370.lo \
        elf32-i386.lo \
-       elf32-i860.lo \
-       elf32-i960.lo \
+       elfxx-x86.lo \
        elf32-ip2k.lo \
        elf32-iq2000.lo \
        elf32-lm32.lo \
@@ -339,7 +321,7 @@ BFD32_BACKENDS = \
        elf32-m68hc12.lo \
        elf32-m68hc1x.lo \
        elf32-m68k.lo \
-       elf32-m88k.lo \
+       elf32-s12z.lo \
        elf32-mcore.lo \
        elf32-mep.lo \
        elf32-metag.lo \
@@ -352,13 +334,11 @@ BFD32_BACKENDS = \
        elf32-or1k.lo \
        elf32-pj.lo \
        elf32-ppc.lo \
+       elf32-pru.lo \
        elf32-rl78.lo \
        elf32-rx.lo \
        elf32-s390.lo \
-       elf32-sh-symbian.lo \
        elf32-sh.lo \
-       elf32-sh64-com.lo \
-       elf32-sh64.lo \
        elf32-sparc.lo \
        elf32-spu.lo \
        elf32-tic6x.lo \
@@ -367,52 +347,30 @@ BFD32_BACKENDS = \
        elf32-v850.lo \
        elf32-vax.lo \
        elf32-visium.lo \
+       elf32-wasm32.lo \
        elf32-xc16x.lo \
        elf32-xgate.lo \
        elf32-xstormy16.lo \
        elf32-xtensa.lo \
+       elf32-z80.lo \
        elf32.lo \
        elflink.lo \
        elfxx-sparc.lo \
        elfxx-tilegx.lo \
-       epoc-pe-arm.lo \
-       epoc-pei-arm.lo \
-       hp300bsd.lo \
-       hp300hpux.lo \
        i386aout.lo \
        i386bsd.lo \
-       i386dynix.lo \
-       i386freebsd.lo \
-       i386linux.lo \
        i386lynx.lo \
-       i386mach3.lo \
        i386msdos.lo \
-       i386netbsd.lo \
-       i386os9k.lo \
-       ieee.lo \
-       m68k4knetbsd.lo \
-       m68klinux.lo \
-       m68knetbsd.lo \
-       m88kmach3.lo \
-       m88kopenbsd.lo \
        mach-o.lo \
        mach-o-i386.lo \
-       mipsbsd.lo \
-       newsos3.lo \
-       nlm.lo \
-       nlm32-i386.lo \
-       nlm32-ppc.lo \
-       nlm32-sparc.lo \
-       nlm32.lo \
+       mach-o-arm.lo \
        ns32knetbsd.lo \
-       oasys.lo \
        pc532-mach.lo \
        pdp11.lo \
        pe-arm-wince.lo \
        pe-arm.lo \
        pe-i386.lo \
        pe-mcore.lo \
-       pe-mips.lo \
        pe-ppc.lo \
        pe-sh.lo \
        pef.lo \
@@ -420,67 +378,38 @@ BFD32_BACKENDS = \
        pei-arm.lo \
        pei-i386.lo \
        pei-mcore.lo \
-       pei-mips.lo \
        pei-ppc.lo \
        pei-sh.lo \
        peigen.lo \
        plugin.lo \
        ppcboot.lo \
        reloc16.lo \
-       riscix.lo \
        som.lo \
-       sparclinux.lo \
-       sparclynx.lo \
-       sparcnetbsd.lo \
-       sunos.lo \
        vax1knetbsd.lo \
-       vaxbsd.lo \
        vaxnetbsd.lo \
-       versados.lo \
        vms-lib.lo \
        vms-misc.lo \
+       wasm-module.lo \
        xcofflink.lo \
        xsym.lo \
        xtensa-isa.lo \
        xtensa-modules.lo
 
 BFD32_BACKENDS_CFILES = \
-       aout-adobe.c \
-       aout-arm.c \
        aout-cris.c \
        aout-ns32k.c \
-       aout-sparcle.c \
        aout-tic30.c \
-       aout0.c \
        aout32.c \
-       armnetbsd.c \
-       bout.c \
        cf-i386lynx.c \
-       cf-sparclynx.c \
-       coff-apollo.c \
-       coff-arm.c \
-       coff-aux.c \
        coff-go32.c \
-       coff-h8300.c \
-       coff-h8500.c \
        coff-i386.c \
-       coff-i860.c \
-       coff-i960.c \
-       coff-m68k.c \
-       coff-m88k.c \
        coff-mips.c \
        coff-rs6000.c \
        coff-sh.c \
-       coff-sparc.c \
        coff-stgo32.c \
-       coff-svm68k.c \
        coff-tic30.c \
        coff-tic4x.c \
        coff-tic54x.c \
-       coff-tic80.c \
-       coff-u68k.c \
-       coff-w65.c \
-       coff-we32k.c \
        coff-z80.c \
        coff-z8k.c \
        coffgen.c \
@@ -504,22 +433,21 @@ BFD32_BACKENDS_CFILES = \
        elf32-avr.c \
        elf32-bfin.c \
        elf32-cr16.c \
-       elf32-cr16c.c \
        elf32-cris.c \
        elf32-crx.c \
+       elf32-csky.c \
        elf32-d10v.c \
        elf32-d30v.c \
        elf32-dlx.c \
        elf32-epiphany.c \
        elf32-fr30.c \
        elf32-frv.c \
+       elf32-ft32.c \
        elf32-gen.c \
        elf32-h8300.c \
        elf32-hppa.c \
-       elf32-i370.c \
        elf32-i386.c \
-       elf32-i860.c \
-       elf32-i960.c \
+       elfxx-x86.c \
        elf32-ip2k.c \
        elf32-iq2000.c \
        elf32-lm32.c \
@@ -529,7 +457,7 @@ BFD32_BACKENDS_CFILES = \
        elf32-m68hc12.c \
        elf32-m68hc1x.c \
        elf32-m68k.c \
-       elf32-m88k.c \
+       elf32-s12z.c \
        elf32-mcore.c \
        elf32-mep.c \
        elf32-metag.c \
@@ -542,13 +470,11 @@ BFD32_BACKENDS_CFILES = \
        elf32-or1k.c \
        elf32-pj.c \
        elf32-ppc.c \
+       elf32-pru.c \
        elf32-rl78.c \
        elf32-rx.c \
        elf32-s390.c \
-       elf32-sh-symbian.c \
        elf32-sh.c \
-       elf32-sh64-com.c \
-       elf32-sh64.c \
        elf32-sparc.c \
        elf32-spu.c \
        elf32-tic6x.c \
@@ -557,52 +483,30 @@ BFD32_BACKENDS_CFILES = \
        elf32-v850.c \
        elf32-vax.c \
        elf32-visium.c \
+       elf32-wasm32.c \
        elf32-xc16x.c \
        elf32-xgate.c \
        elf32-xstormy16.c \
        elf32-xtensa.c \
+       elf32-z80.c \
        elf32.c \
        elflink.c \
        elfxx-sparc.c \
        elfxx-tilegx.c \
-       epoc-pe-arm.c \
-       epoc-pei-arm.c \
-       hp300bsd.c \
-       hp300hpux.c \
        i386aout.c \
        i386bsd.c \
-       i386dynix.c \
-       i386freebsd.c \
-       i386linux.c \
        i386lynx.c \
-       i386mach3.c \
        i386msdos.c \
-       i386netbsd.c \
-       i386os9k.c \
-       ieee.c \
-       m68k4knetbsd.c \
-       m68klinux.c \
-       m68knetbsd.c \
-       m88kmach3.c \
-       m88kopenbsd.c \
        mach-o.c \
        mach-o-i386.c \
-       mipsbsd.c \
-       newsos3.c \
-       nlm.c \
-       nlm32-i386.c \
-       nlm32-ppc.c \
-       nlm32-sparc.c \
-       nlm32.c \
+       mach-o-arm.c \
        ns32knetbsd.c \
-       oasys.c \
        pc532-mach.c \
        pdp11.c \
        pe-arm-wince.c \
        pe-arm.c \
        pe-i386.c \
        pe-mcore.c \
-       pe-mips.c \
        pe-ppc.c \
        pe-sh.c \
        pef.c \
@@ -610,24 +514,17 @@ BFD32_BACKENDS_CFILES = \
        pei-arm.c \
        pei-i386.c \
        pei-mcore.c \
-       pei-mips.c \
        pei-ppc.c \
        pei-sh.c \
        plugin.c \
        ppcboot.c \
        reloc16.c \
-       riscix.c \
        som.c \
-       sparclinux.c \
-       sparclynx.c \
-       sparcnetbsd.c \
-       sunos.c \
        vax1knetbsd.c \
-       vaxbsd.c \
        vaxnetbsd.c \
-       versados.c \
        vms-lib.c \
        vms-misc.c \
+       wasm-module.c \
        xcofflink.c \
        xsym.c \
        xtensa-isa.c \
@@ -647,7 +544,6 @@ BFD64_BACKENDS = \
        coff-alpha.lo \
        coff-x86_64.lo \
        coff64-rs6000.lo \
-       demo64.lo \
        elf32-ia64.lo \
        elf32-mips.lo \
        elf32-score.lo \
@@ -657,22 +553,26 @@ BFD64_BACKENDS = \
        elf64-hppa.lo \
        elf64-ia64.lo \
        elf64-ia64-vms.lo \
+       elfxx-ia64.lo \
+       elfn32-mips.lo \
        elf64-mips.lo \
+       elfxx-mips.lo \
        elf64-mmix.lo \
+       elf64-nfp.lo \
        elf64-ppc.lo \
+       elf32-riscv.lo \
+       elf64-riscv.lo \
+       elfxx-riscv.lo \
        elf64-s390.lo \
-       elf64-sh64.lo \
        elf64-sparc.lo \
        elf64-tilegx.lo \
        elf64-x86-64.lo \
+       elfxx-x86.lo \
+       elf64-bpf.lo \
        elf64.lo \
-       elfn32-mips.lo \
-       elfxx-ia64.lo \
-       elfxx-mips.lo \
+       mach-o-aarch64.lo \
        mach-o-x86-64.lo \
        mmo.lo \
-       nlm32-alpha.lo \
-       nlm64.lo \
        pe-x86_64.lo \
        pei-ia64.lo \
        pei-x86_64.lo \
@@ -686,7 +586,6 @@ BFD64_BACKENDS_CFILES = \
        coff-alpha.c \
        coff-x86_64.c \
        coff64-rs6000.c \
-       demo64.c \
        elf32-mips.c \
        elf32-score.c \
        elf32-score7.c \
@@ -696,21 +595,23 @@ BFD64_BACKENDS_CFILES = \
        elf64-ia64-vms.c \
        elf64-mips.c \
        elf64-mmix.c \
+       elf64-nfp.c \
        elf64-ppc.c \
        elf64-s390.c \
-       elf64-sh64.c \
        elf64-sparc.c \
        elf64-tilegx.c \
        elf64-x86-64.c \
+       elfxx-x86.c \
+       elf64-bpf.c \
        elf64.c \
        elfn32-mips.c \
        elfxx-aarch64.c \
        elfxx-ia64.c \
        elfxx-mips.c \
+       elfxx-riscv.c \
+       mach-o-aarch64.c \
        mach-o-x86-64.c \
        mmo.c \
-       nlm32-alpha.c \
-       nlm64.c \
        pe-x86_64.c \
        pei-ia64.c \
        pei-x86_64.c \
@@ -722,6 +623,7 @@ OPTIONAL_BACKENDS = \
        hpux-core.lo \
        irix-core.lo \
        lynx-core.lo \
+       netbsd-core.lo \
        osf-core.lo \
        rs6000-core.lo \
        sco5-core.lo \
@@ -733,6 +635,7 @@ OPTIONAL_BACKENDS_CFILES = \
        hpux-core.c \
        irix-core.c \
        lynx-core.c \
+       netbsd-core.c \
        osf-core.c \
        rs6000-core.c \
        sco5-core.c \
@@ -753,7 +656,7 @@ BFD_MACHINES = @bfd_machines@
 TDEFAULTS = @tdefaults@
 HAVEVECS = @havevecs@
 
-INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) \
+AM_CPPFLAGS += @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) \
        $(HAVEVECS) @INCINTL@
 
 # C source files that correspond to .o's.
@@ -767,23 +670,41 @@ SOURCE_CFILES = \
 
 BUILD_CFILES = \
        elf32-aarch64.c elf64-aarch64.c \
-       elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c
+       elf32-ia64.c elf64-ia64.c \
+       elf32-riscv.c elf64-riscv.c \
+       peigen.c pepigen.c pex64igen.c
 
 CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
 
-## This is a list of all .h files which are in the source tree.
+## This is a list of all .h files in the source tree minus those that
+## are processed to produce other .h files
 SOURCE_HFILES = \
-       aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
-       elf-bfd.h elf-hppa.h elf-linux-psinfo.h elf32-hppa.h \
-       elf64-hppa.h elfcode.h elfcore.h \
-       freebsd.h genlink.h go32stub.h \
-       libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
-       libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
-       netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
-       pef.h pef-traceback.h peicode.h som.h version.h \
-       vms.h xsym.h
-
-## ... and all .h files which are in the build tree.
+       aout-target.h aoutx.h arc-got.h arc-plt.h \
+       coff-arm.h coff-bfd.h coffcode.h coffswap.h \
+       cpu-aarch64.h cpu-arm.h cpu-h8300.h cpu-m68k.h \
+       ecoff-bfd.h ecoffswap.h \
+       elf32-arm.h elf32-avr.h elf32-bfin.h elf32-cr16.h elf32-csky.h \
+       elf32-dlx.h elf32-hppa.h elf32-m68hc1x.h elf32-m68k.h \
+       elf32-metag.h elf32-nds32.h elf32-nios2.h elf32-ppc.h \
+       elf32-rx.h elf32-score.h elf32-sh-relocs.h elf32-spu.h \
+       elf32-tic6x.h elf32-tilegx.h elf32-tilepro.h elf32-v850.h \
+       elf64-hppa.h elf64-ppc.h elf64-tilegx.h \
+       elf-bfd.h elfcode.h elfcore.h elf-hppa.h elf-linker-x86.h \
+       elf-linux-core.h elf-nacl.h elf-s390.h elf-vxworks.h \
+       elfxx-aarch64.h elfxx-ia64.h elfxx-mips.h elfxx-riscv.h \
+       elfxx-sparc.h elfxx-tilegx.h elfxx-x86.h \
+       genlink.h go32stub.h \
+       libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
+       libpei.h libxcoff.h \
+       mach-o.h \
+       netbsd.h ns32k.h \
+       pef.h pef-traceback.h peicode.h plugin.h \
+       som.h sysdep.h \
+       version.h vms.h \
+       wasm-module.h \
+       xcofflink.h xsym.h
+
+## ... and .h files which are in the build tree, minus config.h and bfd.h
 BUILD_HFILES = \
        bfdver.h elf32-target.h elf64-target.h targmatch.h bfd_stdint.h
 
@@ -836,7 +757,7 @@ ofiles: stamp-ofiles ; @true
 libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
 EXTRA_libbfd_la_SOURCES = $(CFILES)
 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
-libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL)
+libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB)
 libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
 
 # libtool will build .libs/libbfd.a.  We create libbfd.a in the build
@@ -848,7 +769,7 @@ noinst_LIBRARIES = libbfd.a
 libbfd_a_SOURCES =
 
 stamp-lib: libbfd.la
-       libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
+       libtooldir=`$(LIBTOOL) --config | $(SED) -n -e 's/^objdir=//p'`; \
        if [ -f $$libtooldir/libbfd.a ]; then \
          cp $$libtooldir/libbfd.a libbfd.tmp; \
          $(RANLIB) libbfd.tmp; \
@@ -863,7 +784,7 @@ libbfd.a: stamp-lib ; @true
 # itself, but is included by targets.c.
 targmatch.h: config.bfd targmatch.sed
        rm -f targmatch.h
-       sed -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
+       $(SED) -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
        mv -f targmatch.new targmatch.h
 
 # When compiling archures.c and targets.c, supply the default target
@@ -906,54 +827,49 @@ endif
 endif
 
 elf32-target.h : elfxx-target.h
-       rm -f elf32-target.h
-       sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
-       mv -f elf32-target.new elf32-target.h
+       $(SED) -e s/NN/32/g < $< > $@
 
 elf64-target.h : elfxx-target.h
-       rm -f elf64-target.h
-       sed -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new
-       mv -f elf64-target.new elf64-target.h
+       $(SED) -e s/NN/64/g < $< > $@
 
 elf32-aarch64.c : elfnn-aarch64.c
-       rm -f elf32-aarch64.c
-       echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf32-aarch64.new
-       sed -e s/NN/32/g < $(srcdir)/elfnn-aarch64.c >> elf32-aarch64.new
-       mv -f elf32-aarch64.new elf32-aarch64.c
+       echo "#line 1 \"elfnn-aarch64.c\"" > $@
+       $(SED) -e s/NN/32/g < $< >> $@
 
 elf64-aarch64.c : elfnn-aarch64.c
-       rm -f elf64-aarch64.c
-       echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf64-aarch64.new
-       sed -e s/NN/64/g < $(srcdir)/elfnn-aarch64.c >> elf64-aarch64.new
-       mv -f elf64-aarch64.new elf64-aarch64.c
+       echo "#line 1 \"elfnn-aarch64.c\"" > $@
+       $(SED) -e s/NN/64/g < $< >> $@
 
 elf32-ia64.c : elfnn-ia64.c
-       rm -f elf32-ia64.c
-       sed -e s/NN/32/g < $(srcdir)/elfnn-ia64.c > elf32-ia64.new
-       mv -f elf32-ia64.new elf32-ia64.c
+       echo "#line 1 \"elfnn-ia64.c\"" > $@
+       $(SED) -e s/NN/32/g < $< >> $@
 
 elf64-ia64.c : elfnn-ia64.c
-       rm -f elf64-ia64.c
-       sed -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new
-       mv -f elf64-ia64.new elf64-ia64.c
+       echo "#line 1 \"elfnn-ia64.c\"" > $@
+       $(SED) -e s/NN/64/g < $< >> $@
+
+elf32-riscv.c : elfnn-riscv.c
+       echo "#line 1 \"elfnn-riscv.c\"" > $@
+       $(SED) -e s/NN/32/g < $< >> $@
+
+elf64-riscv.c : elfnn-riscv.c
+       echo "#line 1 \"elfnn-riscv.c\"" > $@
+       $(SED) -e s/NN/64/g < $< >> $@
 
 peigen.c : peXXigen.c
-       rm -f peigen.c
-       sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new
-       mv -f peigen.new peigen.c
+       echo "#line 1 \"peXXigen.c\"" > $@
+       $(SED) -e s/XX/pe/g < $< >> $@
 
 pepigen.c : peXXigen.c
-       rm -f pepigen.c
-       sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new
-       mv -f pepigen.new pepigen.c
+       echo "#line 1 \"peXXigen.c\"" > $@
+       $(SED) -e s/XX/pep/g < $< >> $@
 
 pex64igen.c: peXXigen.c
-       rm -f pex64igen.c
-       sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new
-       mv -f pex64igen.new pex64igen.c
+       echo "#line 1 \"peXXigen.c\"" > $@
+       $(SED) -e s/XX/pex64/g < $< >> $@
 
-BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
-LOCAL_H_DEPS= libbfd.h sysdep.h config.h
+BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/diagnostics.h
+LOCAL_H_DEPS= libbfd.h sysdep.h config.h bfd_stdint.h
 $(BFD32_LIBS) \
  $(BFD64_LIBS) \
  $(ALL_MACHINES) \
@@ -979,12 +895,13 @@ stmp-bfd-h: bfd-in3.h
        rm -f bfd-tmp.h
        touch stmp-bfd-h
 
-BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
-       reloc.c syms.c bfd.c bfdio.c bfdwin.c \
-       archive.c corefile.c targets.c format.c compress.c
+BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c \
+       bfdio.c bfdwin.c section.c archures.c reloc.c \
+       syms.c bfd.c archive.c corefile.c targets.c format.c \
+       linker.c simple.c compress.c
 BFD64_H_FILES = archive64.c
-LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \
-       cache.c reloc.c archures.c elf.c
+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
 
 # Could really use a "copy-if-change"...
@@ -1030,18 +947,18 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
 
 bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
        @echo "creating $@"
-       @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
+       @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
        bfd_version_string="\"$(VERSION)\"" ;\
        bfd_soversion="$(VERSION)" ;\
        bfd_version_package="\"$(PKGVERSION)\"" ;\
        report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
        . $(srcdir)/development.sh ;\
        if test "$$development" = true ; then \
-         bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
+         bfd_version_date=`$(SED) -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
          bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
          bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
        fi ;\
-       sed -e "s,@bfd_version@,$$bfd_version," \
+       $(SED) -e "s,@bfd_version@,$$bfd_version," \
            -e "s,@bfd_version_string@,$$bfd_version_string," \
            -e "s,@bfd_version_package@,$$bfd_version_package," \
            -e "s,@report_bugs_to@,$$report_bugs_to," \