ubsan: som.c undefined shift in som_set_reloc_info
[binutils-gdb.git] / bfd / Makefile.am
index b6088a3c4a86048b4d0ad37c49bbf7c515f1f36a..670e0598f55f29f3d5db4ffa18e40dcbc390f977 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 #
-#   Copyright (C) 2012-2020 Free Software Foundation, Inc.
+#   Copyright (C) 2012-2022 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
 # <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
 
@@ -33,7 +38,7 @@ bfdlibdir = @bfdlibdir@
 bfdincludedir = @bfdincludedir@
 bfdlib_LTLIBRARIES = libbfd.la
 bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
-                    bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
+                    $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
 else !INSTALL_LIBBFD
 # Empty these so that the respective installation directories will not be created.
 bfdlibdir =
@@ -53,7 +58,7 @@ ZLIBINC = @zlibinc@
 WARN_CFLAGS = @WARN_CFLAGS@
 NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC)
-AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DLIBDIR='"$(libdir)"'
+AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DLIBDIR='"$(libdir)"' @LARGEFILE_CPPFLAGS@
 if PLUGINS
 bfdinclude_HEADERS += $(INCDIR)/plugin-api.h
 LIBDL = @lt_cv_dlopen_libs@
@@ -92,6 +97,7 @@ BFD64_LIBS_CFILES = archive64.c
 ALL_MACHINES = \
        cpu-aarch64.lo \
        cpu-alpha.lo \
+       cpu-amdgcn.lo \
        cpu-arc.lo \
        cpu-arm.lo \
        cpu-avr.lo \
@@ -112,12 +118,11 @@ ALL_MACHINES = \
        cpu-hppa.lo \
        cpu-i386.lo \
        cpu-iamcu.lo \
-       cpu-l1om.lo \
-       cpu-k1om.lo \
        cpu-ia64.lo \
        cpu-ip2k.lo \
        cpu-iq2000.lo \
        cpu-lm32.lo \
+       cpu-loongarch.lo \
        cpu-m10200.lo \
        cpu-m10300.lo \
        cpu-m32c.lo \
@@ -166,7 +171,6 @@ ALL_MACHINES = \
        cpu-vax.lo \
        cpu-visium.lo \
        cpu-wasm32.lo \
-       cpu-xc16x.lo \
        cpu-xgate.lo \
        cpu-xstormy16.lo \
        cpu-xtensa.lo \
@@ -176,6 +180,7 @@ ALL_MACHINES = \
 ALL_MACHINES_CFILES = \
        cpu-aarch64.c \
        cpu-alpha.c \
+       cpu-amdgcn.c \
        cpu-arc.c \
        cpu-arm.c \
        cpu-avr.c \
@@ -196,12 +201,11 @@ ALL_MACHINES_CFILES = \
        cpu-hppa.c \
        cpu-i386.c \
        cpu-iamcu.c \
-       cpu-l1om.c \
-       cpu-k1om.c \
        cpu-ia64.c \
        cpu-ip2k.c \
        cpu-iq2000.c \
        cpu-lm32.c \
+       cpu-loongarch.c \
        cpu-m10200.c \
        cpu-m10300.c \
        cpu-m32c.c \
@@ -250,7 +254,6 @@ ALL_MACHINES_CFILES = \
        cpu-vax.c \
        cpu-visium.c \
        cpu-wasm32.c \
-       cpu-xc16x.c \
        cpu-xgate.c \
        cpu-xstormy16.c \
        cpu-xtensa.c \
@@ -262,7 +265,6 @@ ALL_MACHINES_CFILES = \
 BFD32_BACKENDS = \
        aout-cris.lo \
        aout-ns32k.lo \
-       aout-tic30.lo \
        aout32.lo \
        cf-i386lynx.lo \
        coff-go32.lo \
@@ -348,7 +350,6 @@ BFD32_BACKENDS = \
        elf32-vax.lo \
        elf32-visium.lo \
        elf32-wasm32.lo \
-       elf32-xc16x.lo \
        elf32-xgate.lo \
        elf32-xstormy16.lo \
        elf32-xtensa.lo \
@@ -371,14 +372,12 @@ BFD32_BACKENDS = \
        pe-arm.lo \
        pe-i386.lo \
        pe-mcore.lo \
-       pe-ppc.lo \
        pe-sh.lo \
        pef.lo \
        pei-arm-wince.lo \
        pei-arm.lo \
        pei-i386.lo \
        pei-mcore.lo \
-       pei-ppc.lo \
        pei-sh.lo \
        peigen.lo \
        plugin.lo \
@@ -398,7 +397,6 @@ BFD32_BACKENDS = \
 BFD32_BACKENDS_CFILES = \
        aout-cris.c \
        aout-ns32k.c \
-       aout-tic30.c \
        aout32.c \
        cf-i386lynx.c \
        coff-go32.c \
@@ -484,7 +482,6 @@ BFD32_BACKENDS_CFILES = \
        elf32-vax.c \
        elf32-visium.c \
        elf32-wasm32.c \
-       elf32-xc16x.c \
        elf32-xgate.c \
        elf32-xstormy16.c \
        elf32-xtensa.c \
@@ -507,14 +504,12 @@ BFD32_BACKENDS_CFILES = \
        pe-arm.c \
        pe-i386.c \
        pe-mcore.c \
-       pe-ppc.c \
        pe-sh.c \
        pef.c \
        pei-arm-wince.c \
        pei-arm.c \
        pei-i386.c \
        pei-mcore.c \
-       pei-ppc.c \
        pei-sh.c \
        plugin.c \
        ppcboot.c \
@@ -549,11 +544,15 @@ BFD64_BACKENDS = \
        elf32-score.lo \
        elf32-score7.lo \
        elf64-alpha.lo \
+       elf64-amdgcn.lo \
        elf64-gen.lo \
        elf64-hppa.lo \
        elf64-ia64.lo \
        elf64-ia64-vms.lo \
        elfxx-ia64.lo \
+       elf32-loongarch.lo \
+       elf64-loongarch.lo \
+       elfxx-loongarch.lo \
        elfn32-mips.lo \
        elf64-mips.lo \
        elfxx-mips.lo \
@@ -573,7 +572,9 @@ BFD64_BACKENDS = \
        mach-o-aarch64.lo \
        mach-o-x86-64.lo \
        mmo.lo \
+       pe-aarch64igen.lo \
        pe-x86_64.lo \
+       pei-aarch64.lo \
        pei-ia64.lo \
        pei-x86_64.lo \
        pepigen.lo \
@@ -590,6 +591,7 @@ BFD64_BACKENDS_CFILES = \
        elf32-score.c \
        elf32-score7.c \
        elf64-alpha.c \
+       elf64-amdgcn.c \
        elf64-gen.c \
        elf64-hppa.c \
        elf64-ia64-vms.c \
@@ -607,12 +609,14 @@ BFD64_BACKENDS_CFILES = \
        elfn32-mips.c \
        elfxx-aarch64.c \
        elfxx-ia64.c \
+       elfxx-loongarch.c \
        elfxx-mips.c \
        elfxx-riscv.c \
        mach-o-aarch64.c \
        mach-o-x86-64.c \
        mmo.c \
        pe-x86_64.c \
+       pei-aarch64.c \
        pei-ia64.c \
        pei-x86_64.c \
        vms-alpha.c
@@ -671,8 +675,9 @@ SOURCE_CFILES = \
 BUILD_CFILES = \
        elf32-aarch64.c elf64-aarch64.c \
        elf32-ia64.c elf64-ia64.c \
+       elf32-loongarch.c elf64-loongarch.c \
        elf32-riscv.c elf64-riscv.c \
-       peigen.c pepigen.c pex64igen.c
+       peigen.c pepigen.c pex64igen.c pe-aarch64igen.c
 
 CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
 
@@ -681,7 +686,7 @@ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
 SOURCE_HFILES = \
        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 \
+       cpu-aarch64.h cpu-arm.h cpu-h8300.h cpu-m68k.h cpu-riscv.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 \
@@ -692,7 +697,7 @@ SOURCE_HFILES = \
        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 \
+       elfxx-sparc.h elfxx-tilegx.h elfxx-x86.h elfxx-loongarch.h \
        genlink.h go32stub.h \
        libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
        libpei.h libxcoff.h \
@@ -706,13 +711,22 @@ SOURCE_HFILES = \
 
 ## ... 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
+       bfdver.h elf32-target.h elf64-target.h targmatch.h
 
 # Ensure they are built early:
 BUILT_SOURCES = $(BUILD_HFILES)
 
 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
 
+BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/diagnostics.h
+LOCAL_H_DEPS = libbfd.h sysdep.h config.h
+$(BFD32_LIBS) \
+ $(BFD64_LIBS) \
+ $(ALL_MACHINES) \
+ $(BFD32_BACKENDS) \
+ $(BFD64_BACKENDS) \
+ $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+
 SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
 BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 
@@ -783,99 +797,102 @@ libbfd.a: stamp-lib ; @true
 # vector names.  It is built from config.bfd.  It is not compiled by
 # 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
-       mv -f targmatch.new targmatch.h
+       $(AM_V_at)rm -f targmatch.new
+       $(AM_V_GEN)$(SED) -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
+       $(AM_V_at)mv -f targmatch.new targmatch.h
 
 # When compiling archures.c and targets.c, supply the default target
 # info from configure.
 
 targets.lo: targets.c Makefile
 if am__fastdepCC
-       $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
-       mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+       $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
+       $(AM_V_at)mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 else
 if AMDEP
        source='targets.c' object='$@' libtool=yes @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif
-       $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
+       $(AM_V_CC)$(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
 endif
 
 archures.lo: archures.c Makefile
 if am__fastdepCC
-       $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
-       mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+       $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
+       $(AM_V_at)mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 else
 if AMDEP
        source='archures.c' object='$@' libtool=yes @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif
-       $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
+       $(AM_V_CC)$(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
 endif
 
 dwarf2.lo: dwarf2.c Makefile
 if am__fastdepCC
-       $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
-       mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+       $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
+       $(AM_V_at)mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 else
 if AMDEP
        source='dwarf2.c' object='$@' libtool=yes @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif
-       $(LTCOMPILE) -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
+       $(AM_V_CC)$(LTCOMPILE) -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
 endif
 
 elf32-target.h : elfxx-target.h
-       $(SED) -e s/NN/32/g < $< > $@
+       $(AM_V_GEN)$(SED) -e s/NN/32/g < $< > $@
 
 elf64-target.h : elfxx-target.h
-       $(SED) -e s/NN/64/g < $< > $@
+       $(AM_V_GEN)$(SED) -e s/NN/64/g < $< > $@
 
 elf32-aarch64.c : elfnn-aarch64.c
-       echo "#line 1 \"elfnn-aarch64.c\"" > $@
-       $(SED) -e s/NN/32/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"elfnn-aarch64.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/32/g < $< >> $@
 
 elf64-aarch64.c : elfnn-aarch64.c
-       echo "#line 1 \"elfnn-aarch64.c\"" > $@
-       $(SED) -e s/NN/64/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"elfnn-aarch64.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/64/g < $< >> $@
 
 elf32-ia64.c : elfnn-ia64.c
-       echo "#line 1 \"elfnn-ia64.c\"" > $@
-       $(SED) -e s/NN/32/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"elfnn-ia64.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/32/g < $< >> $@
 
 elf64-ia64.c : elfnn-ia64.c
-       echo "#line 1 \"elfnn-ia64.c\"" > $@
-       $(SED) -e s/NN/64/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"elfnn-ia64.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/64/g < $< >> $@
+
+elf32-loongarch.c : elfnn-loongarch.c
+       $(AM_V_at)echo "#line 1 \"elfnn-loongarch.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/32/g < $< >> $@
+
+elf64-loongarch.c : elfnn-loongarch.c
+       $(AM_V_at)echo "#line 1 \"elfnn-loongarch.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/64/g < $< >> $@
 
 elf32-riscv.c : elfnn-riscv.c
-       echo "#line 1 \"elfnn-riscv.c\"" > $@
-       $(SED) -e s/NN/32/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"elfnn-riscv.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/32/g < $< >> $@
 
 elf64-riscv.c : elfnn-riscv.c
-       echo "#line 1 \"elfnn-riscv.c\"" > $@
-       $(SED) -e s/NN/64/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"elfnn-riscv.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/NN/64/g < $< >> $@
 
 peigen.c : peXXigen.c
-       echo "#line 1 \"peXXigen.c\"" > $@
-       $(SED) -e s/XX/pe/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/XX/pe/g < $< >> $@
 
 pepigen.c : peXXigen.c
-       echo "#line 1 \"peXXigen.c\"" > $@
-       $(SED) -e s/XX/pep/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/XX/pep/g < $< >> $@
 
 pex64igen.c: peXXigen.c
-       echo "#line 1 \"peXXigen.c\"" > $@
-       $(SED) -e s/XX/pex64/g < $< >> $@
+       $(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/XX/pex64/g < $< >> $@
 
-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) \
- $(BFD32_BACKENDS) \
- $(BFD64_BACKENDS) \
- $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+pe-aarch64igen.c: peXXigen.c
+       $(AM_V_at)echo "#line 1 \"peXXigen.c\"" > $@
+       $(AM_V_GEN)$(SED) -e s/XX/peAArch64/g < $< >> $@
 
 host-aout.lo: Makefile
 
@@ -904,50 +921,58 @@ 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"...
-headers:
-       (cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
-       cp $(bfddocdir)/bfd.h bfd-in2.h-new
-       $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-       cp $(bfddocdir)/libbfd.h libbfd.h-new
-       $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-       cp $(bfddocdir)/libcoff.h libcoff.h-new
-       $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+headers: stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
 # We only rebuild the header files automatically if we have been
 # configured with --enable-maintainer-mode.
 
+REGEN_HEADER = \
+       ( \
+       set -e; \
+       echo "$$H_FILES" | sed -f $(srcdir)/doc/header.sed; \
+       for file in $$H_FILES; do \
+         file="$(srcdir)/$$file"; \
+         case $$file in \
+           *-in.h) cat $$file;; \
+           *)  echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+                               -e 's,$$,.  */,'; \
+               $(MKDOC) $$CHEW_FLAGS -f $(srcdir)/doc/proto.str < $$file;; \
+         esac; \
+       done; \
+       echo "\#ifdef __cplusplus"; \
+       echo "}"; \
+       echo "\#endif"; \
+       echo "\#endif"; \
+       )
+
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
-stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
-       (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
-       cp $(bfddocdir)/bfd.h bfd-in2.h-new
-       $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-       touch stmp-bin2-h
+stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
+       $(AM_V_GEN)H_FILES="$(BFD_H_FILES)" CHEW_FLAGS= ; $(REGEN_HEADER) > bfd-in2.h-new
+       $(AM_V_at)$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
+       $(AM_V_at)touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
-stmp-lbfd-h: $(LIBBFD_H_FILES)
-       (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
-       cp $(bfddocdir)/libbfd.h libbfd.h-new
-       $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-       touch stmp-lbfd-h
+stmp-lbfd-h: $(LIBBFD_H_FILES) $(MKDOC)
+       $(AM_V_GEN)H_FILES="$(LIBBFD_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libbfd.h-new
+       $(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
+       $(AM_V_at)touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
-stmp-lcoff-h: $(LIBCOFF_H_FILES)
-       (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
-       cp $(bfddocdir)/libcoff.h libcoff.h-new
-       $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
-       touch stmp-lcoff-h
+stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
+       $(AM_V_GEN)H_FILES="$(LIBCOFF_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libcoff.h-new
+       $(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
-       @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/'` ;\
+       $(AM_V_GEN)\
+       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)\"" ;\
@@ -968,15 +993,17 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
 # Disable -Werror, if it has been enabled, since coffswap.h won't
 # compile with gcc 4.5 and above.
 coff-tic4x.lo: coff-tic4x.c
-@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $< $(NO_WERROR)
+@am__fastdepCC_FALSE@  $(AM_V_CC)$(LTCOMPILE) -c -o $@ $< $(NO_WERROR)
 
 coff-tic54x.lo: coff-tic54x.c
-@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $< $(NO_WERROR)
+@am__fastdepCC_FALSE@  $(AM_V_CC)$(LTCOMPILE) -c -o $@ $< $(NO_WERROR)
+
+include doc/local.mk