1 ## Process this file with automake to generate Makefile.in
3 # Copyright (C) 2012-2021 Free Software Foundation, Inc.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
20 AUTOMAKE_OPTIONS = no-dist foreign
21 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
23 INCDIR = $(srcdir)/../include
24 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
32 bfdlibdir = @bfdlibdir@
33 bfdincludedir = @bfdincludedir@
34 bfdlib_LTLIBRARIES = libbfd.la
35 bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
36 $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
38 # Empty these so that the respective installation directories will not be created.
42 rpath_bfdlibdir = @bfdlibdir@
43 noinst_LTLIBRARIES = libbfd.la
44 libbfd_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
47 # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
48 # -I../zlib, unless we were configured with --with-system-zlib, in which
49 # case both are empty.
53 WARN_CFLAGS = @WARN_CFLAGS@
54 NO_WERROR = @NO_WERROR@
55 AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC)
56 AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DLIBDIR='"$(libdir)"' @LARGEFILE_CPPFLAGS@
58 bfdinclude_HEADERS += $(INCDIR)/plugin-api.h
59 LIBDL = @lt_cv_dlopen_libs@
62 # bfd.h goes here, for now
66 # Writing S-records should be included in all (or at least most)
67 # *-*-coff, *-*-aout, etc., configurations, because people will want to
68 # be able to use objcopy to create S-records. (S-records are not useful
69 # for the debugger, so if you are downloading things as S-records you
70 # need two copies of the executable, one to download and one for the
73 archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo \
74 coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo \
75 hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo \
76 section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo \
77 binary.lo ihex.lo srec.lo tekhex.lo verilog.lo
79 BFD64_LIBS = archive64.lo
82 archive.c archures.c bfd.c bfdio.c bfdwin.c cache.c coff-bfd.c \
83 compress.c corefile.c elf-properties.c format.c hash.c \
84 init.c libbfd.c linker.c merge.c opncls.c reloc.c \
85 section.c simple.c stab-syms.c stabs.c syms.c targets.c \
86 binary.c ihex.c srec.c tekhex.c verilog.c
88 BFD64_LIBS_CFILES = archive64.c
90 # This list is alphabetized to make it easier to keep in sync
91 # with the decls and initializer in archures.c.
177 ALL_MACHINES_CFILES = \
262 # The .o files needed by all of the 32 bit vectors that are configured into
263 # target_vector in targets.c if configured with --enable-targets=all.
329 elf32-microblaze.lo \
397 BFD32_BACKENDS_CFILES = \
529 # The .o files needed by all of the 64 bit vectors that are configured into
530 # target_vector in targets.c if configured with --enable-targets=all
531 # and --enable-64-bit-bfd.
532 # elf32-ia64.c requires a 64-bit bfd_vma, and hence can not be put in
584 BFD64_BACKENDS_CFILES = \
623 OPTIONAL_BACKENDS = \
635 OPTIONAL_BACKENDS_CFILES = \
647 # Reconfigure if config.bfd or configure.host changes.
648 # development.sh is used to determine -Werror default.
649 CONFIG_STATUS_DEPENDENCIES = \
650 $(srcdir)/config.bfd \
651 $(srcdir)/configure.host \
652 $(srcdir)/development.sh
654 # These are defined by configure:
655 WORDSIZE = @wordsize@
656 ALL_BACKENDS = @all_backends@
657 BFD_BACKENDS = @bfd_backends@
658 BFD_MACHINES = @bfd_machines@
659 TDEFAULTS = @tdefaults@
660 HAVEVECS = @havevecs@
662 AM_CPPFLAGS += @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) \
663 $(HAVEVECS) @INCINTL@
665 # C source files that correspond to .o's.
667 $(BFD32_LIBS_CFILES) \
668 $(BFD64_LIBS_CFILES) \
669 $(ALL_MACHINES_CFILES) \
670 $(BFD32_BACKENDS_CFILES) \
671 $(BFD64_BACKENDS_CFILES) \
672 $(OPTIONAL_BACKENDS_CFILES)
675 elf32-aarch64.c elf64-aarch64.c \
676 elf32-ia64.c elf64-ia64.c \
677 elf32-loongarch.c elf64-loongarch.c \
678 elf32-riscv.c elf64-riscv.c \
679 peigen.c pepigen.c pex64igen.c pe-aarch64igen.c
681 CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
683 ## This is a list of all .h files in the source tree minus those that
684 ## are processed to produce other .h files
686 aout-target.h aoutx.h arc-got.h arc-plt.h \
687 coff-arm.h coff-bfd.h coffcode.h coffswap.h \
688 cpu-aarch64.h cpu-arm.h cpu-h8300.h cpu-m68k.h cpu-riscv.h \
689 ecoff-bfd.h ecoffswap.h \
690 elf32-arm.h elf32-avr.h elf32-bfin.h elf32-cr16.h elf32-csky.h \
691 elf32-dlx.h elf32-hppa.h elf32-m68hc1x.h elf32-m68k.h \
692 elf32-metag.h elf32-nds32.h elf32-nios2.h elf32-ppc.h \
693 elf32-rx.h elf32-score.h elf32-sh-relocs.h elf32-spu.h \
694 elf32-tic6x.h elf32-tilegx.h elf32-tilepro.h elf32-v850.h \
695 elf64-hppa.h elf64-ppc.h elf64-tilegx.h \
696 elf-bfd.h elfcode.h elfcore.h elf-hppa.h elf-linker-x86.h \
697 elf-linux-core.h elf-nacl.h elf-s390.h elf-vxworks.h \
698 elfxx-aarch64.h elfxx-ia64.h elfxx-mips.h elfxx-riscv.h \
699 elfxx-sparc.h elfxx-tilegx.h elfxx-x86.h elfxx-loongarch.h \
700 genlink.h go32stub.h \
701 libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
702 libpei.h libxcoff.h \
705 pef.h pef-traceback.h peicode.h plugin.h \
711 ## ... and .h files which are in the build tree, minus config.h and bfd.h
713 bfdver.h elf32-target.h elf64-target.h targmatch.h
715 # Ensure they are built early:
716 BUILT_SOURCES = $(BUILD_HFILES)
718 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
720 SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
721 BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
723 po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
724 for file in $(SRC_POTFILES); do echo $$file; done \
725 | LC_ALL=C sort > tmp.src \
726 && mv tmp.src $(srcdir)/po/SRC-POTFILES.in
728 po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
729 for file in $(BLD_POTFILES); do echo $$file; done \
730 | LC_ALL=C sort > tmp.bld \
731 && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
735 # Various kinds of .o files to put in libbfd.a:
736 # BFD_BACKENDS Routines the configured targets need.
737 # BFD_MACHINES Architecture-specific routines the configured targets need.
738 # COREFILE Core file routines for a native configuration
739 # bfd64_libs Routines for 64bit support
740 OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@
742 stamp-ofiles: Makefile
745 for i in $(OFILES) ; do \
752 $(SHELL) $(srcdir)/../move-if-change tofiles ofiles
755 ofiles: stamp-ofiles ; @true
757 # Since BFD64_LIBS is optional and we can't have substitution in
758 # libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
759 # However, list all sources in EXTRA_libbfd_la_SOURCES so the
760 # dependency tracking fragments are picked up in the Makefile.
761 libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
762 EXTRA_libbfd_la_SOURCES = $(CFILES)
763 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
764 libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) $(ZLIB)
765 libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
767 # libtool will build .libs/libbfd.a. We create libbfd.a in the build
768 # directory so that we don't have to convert all the programs that use
769 # libbfd.a simultaneously. This is a hack which should be removed if
770 # everything else starts using libtool. FIXME.
772 noinst_LIBRARIES = libbfd.a
776 libtooldir=`$(LIBTOOL) --config | $(SED) -n -e 's/^objdir=//p'`; \
777 if [ -f $$libtooldir/libbfd.a ]; then \
778 cp $$libtooldir/libbfd.a libbfd.tmp; \
779 $(RANLIB) libbfd.tmp; \
780 $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
784 libbfd.a: stamp-lib ; @true
786 # This file holds an array associating configuration triplets and
787 # vector names. It is built from config.bfd. It is not compiled by
788 # itself, but is included by targets.c.
789 targmatch.h: config.bfd targmatch.sed
791 $(SED) -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
792 mv -f targmatch.new targmatch.h
794 # When compiling archures.c and targets.c, supply the default target
795 # info from configure.
797 targets.lo: targets.c Makefile
799 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
800 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
803 source='targets.c' object='$@' libtool=yes @AMDEPBACKSLASH@
804 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
806 $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
809 archures.lo: archures.c Makefile
811 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
812 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
815 source='archures.c' object='$@' libtool=yes @AMDEPBACKSLASH@
816 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
818 $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
821 dwarf2.lo: dwarf2.c Makefile
823 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
824 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
827 source='dwarf2.c' object='$@' libtool=yes @AMDEPBACKSLASH@
828 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
830 $(LTCOMPILE) -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
833 elf32-target.h : elfxx-target.h
834 $(SED) -e s/NN/32/g < $< > $@
836 elf64-target.h : elfxx-target.h
837 $(SED) -e s/NN/64/g < $< > $@
839 elf32-aarch64.c : elfnn-aarch64.c
840 echo "#line 1 \"elfnn-aarch64.c\"" > $@
841 $(SED) -e s/NN/32/g < $< >> $@
843 elf64-aarch64.c : elfnn-aarch64.c
844 echo "#line 1 \"elfnn-aarch64.c\"" > $@
845 $(SED) -e s/NN/64/g < $< >> $@
847 elf32-ia64.c : elfnn-ia64.c
848 echo "#line 1 \"elfnn-ia64.c\"" > $@
849 $(SED) -e s/NN/32/g < $< >> $@
851 elf64-ia64.c : elfnn-ia64.c
852 echo "#line 1 \"elfnn-ia64.c\"" > $@
853 $(SED) -e s/NN/64/g < $< >> $@
855 elf32-loongarch.c : elfnn-loongarch.c
856 echo "#line 1 \"elfnn-loongarch.c\"" > $@
857 $(SED) -e s/NN/32/g < $< >> $@
859 elf64-loongarch.c : elfnn-loongarch.c
860 echo "#line 1 \"elfnn-loongarch.c\"" > $@
861 $(SED) -e s/NN/64/g < $< >> $@
863 elf32-riscv.c : elfnn-riscv.c
864 echo "#line 1 \"elfnn-riscv.c\"" > $@
865 $(SED) -e s/NN/32/g < $< >> $@
867 elf64-riscv.c : elfnn-riscv.c
868 echo "#line 1 \"elfnn-riscv.c\"" > $@
869 $(SED) -e s/NN/64/g < $< >> $@
871 peigen.c : peXXigen.c
872 echo "#line 1 \"peXXigen.c\"" > $@
873 $(SED) -e s/XX/pe/g < $< >> $@
875 pepigen.c : peXXigen.c
876 echo "#line 1 \"peXXigen.c\"" > $@
877 $(SED) -e s/XX/pep/g < $< >> $@
879 pex64igen.c: peXXigen.c
880 echo "#line 1 \"peXXigen.c\"" > $@
881 $(SED) -e s/XX/pex64/g < $< >> $@
883 pe-aarch64igen.c: peXXigen.c
884 echo "#line 1 \"peXXigen.c\"" > $@
885 $(SED) -e s/XX/peAArch64/g < $< >> $@
887 BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/diagnostics.h
888 LOCAL_H_DEPS= libbfd.h sysdep.h config.h
894 $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
896 host-aout.lo: Makefile
898 # The following program can be used to generate a simple config file
899 # which can be folded into an h-XXX file for a new host, with some editing.
900 aout-params.h: gen-aout
901 ./gen-aout host > aout-params.h
902 gen-aout: $(srcdir)/gen-aout.c Makefile
903 $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
905 $(BFD_H): stmp-bfd-h ; @true
907 stmp-bfd-h: bfd-in3.h
909 cp bfd-in3.h bfd-tmp.h
910 $(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
914 BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c \
915 bfdio.c bfdwin.c section.c archures.c reloc.c \
916 syms.c bfd.c archive.c corefile.c targets.c format.c \
917 linker.c simple.c compress.c
918 BFD64_H_FILES = archive64.c
919 LIBBFD_H_FILES = libbfd-in.h libbfd.c bfdio.c bfdwin.c \
920 cache.c reloc.c archures.c linker.c
921 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
923 # Could really use a "copy-if-change"...
925 (cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
926 cp $(bfddocdir)/bfd.h bfd-in2.h-new
927 $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
928 cp $(bfddocdir)/libbfd.h libbfd.h-new
929 $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
930 cp $(bfddocdir)/libcoff.h libcoff.h-new
931 $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
933 # We only rebuild the header files automatically if we have been
934 # configured with --enable-maintainer-mode.
936 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
937 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
938 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
939 cp $(bfddocdir)/bfd.h bfd-in2.h-new
940 $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
943 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
944 stmp-lbfd-h: $(LIBBFD_H_FILES)
945 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
946 cp $(bfddocdir)/libbfd.h libbfd.h-new
947 $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
950 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
951 stmp-lcoff-h: $(LIBCOFF_H_FILES)
952 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
953 cp $(bfddocdir)/libcoff.h libcoff.h-new
954 $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
957 MOSTLYCLEANFILES = ofiles stamp-ofiles
959 CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
960 stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
962 DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
964 bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
966 @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
967 bfd_version_string="\"$(VERSION)\"" ;\
968 bfd_soversion="$(VERSION)" ;\
969 bfd_version_package="\"$(PKGVERSION)\"" ;\
970 report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
971 . $(srcdir)/development.sh ;\
972 if test "$$development" = true ; then \
973 bfd_version_date=`$(SED) -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
974 bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
975 bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
977 $(SED) -e "s,@bfd_version@,$$bfd_version," \
978 -e "s,@bfd_version_string@,$$bfd_version_string," \
979 -e "s,@bfd_version_package@,$$bfd_version_package," \
980 -e "s,@report_bugs_to@,$$report_bugs_to," \
981 < $(srcdir)/version.h > $@; \
982 echo "$${bfd_soversion}" > libtool-soversion
984 # Disable -Werror, if it has been enabled, since coffswap.h won't
985 # compile with gcc 4.5 and above.
986 coff-tic4x.lo: coff-tic4x.c
987 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
988 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
989 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
990 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
991 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< $(NO_WERROR)
993 coff-tic54x.lo: coff-tic54x.c
994 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
995 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
996 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
997 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
998 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< $(NO_WERROR)