1 ## Process this file with automake to generate Makefile.in
3 # Copyright (C) 2012-2014 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 = 1.11 no-dist foreign
21 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
23 # Uncomment the following line when doing a release.
26 INCDIR = $(srcdir)/../include
27 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
35 bfdlibdir = @bfdlibdir@
36 bfdincludedir = @bfdincludedir@
37 bfdlib_LTLIBRARIES = libbfd.la
38 bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
40 # Empty these so that the respective installation directories will not be created.
44 rpath_bfdlibdir = @bfdlibdir@
45 noinst_LTLIBRARIES = libbfd.la
46 libbfd_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
49 WARN_CFLAGS = @WARN_CFLAGS@
50 NO_WERROR = @NO_WERROR@
51 AM_CFLAGS = $(WARN_CFLAGS)
52 AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
54 bfdinclude_HEADERS += $(INCDIR)/plugin-api.h
55 LIBDL = @lt_cv_dlopen_libs@
58 # bfd.h goes here, for now
62 # Writing S-records should be included in all (or at least most)
63 # *-*-coff, *-*-aout, etc., configurations, because people will want to
64 # be able to use objcopy to create S-records. (S-records are not useful
65 # for the debugger, so if you are downloading things as S-records you
66 # need two copies of the executable, one to download and one for the
69 archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
70 cache.lo coffgen.lo corefile.lo \
71 format.lo init.lo libbfd.lo opncls.lo reloc.lo \
72 section.lo syms.lo targets.lo hash.lo linker.lo \
73 srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
74 merge.lo dwarf2.lo simple.lo compress.lo verilog.lo
76 BFD64_LIBS = archive64.lo
79 archive.c archures.c bfd.c bfdio.c bfdwin.c \
80 cache.c coffgen.c corefile.c \
81 format.c init.c libbfd.c opncls.c reloc.c \
82 section.c syms.c targets.c hash.c linker.c \
83 srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
84 merge.c dwarf2.c simple.c compress.c verilog.c
86 BFD64_LIBS_CFILES = archive64.c
88 # This list is alphabetized to make it easier to keep in sync
89 # with the decls and initializer in archures.c.
174 ALL_MACHINES_CFILES = \
258 # The .o files needed by all of the 32 bit vectors that are configured into
259 # target_vector in targets.c if configured with --enable-targets=all.
347 elf32-microblaze.lo \
359 elf32-sh-symbian.lo \
447 BFD32_BACKENDS_CFILES = \
633 # The .o files needed by all of the 64 bit vectors that are configured into
634 # target_vector in targets.c if configured with --enable-targets=all
635 # and --enable-64-bit-bfd.
636 # elf32-ia64.c requires a 64-bit bfd_vma, and hence can not be put in
680 BFD64_BACKENDS_CFILES = \
716 OPTIONAL_BACKENDS = \
727 OPTIONAL_BACKENDS_CFILES = \
738 # We want to rerun configure if configure.in, config.bfd or
739 # configure.host change. configure.in is needed since the version
740 # number in Makefile comes from configure.in.
741 CONFIG_STATUS_DEPENDENCIES = \
742 $(srcdir)/configure.in \
743 $(srcdir)/config.bfd \
744 $(srcdir)/configure.host \
745 $(srcdir)/development.sh
747 # These are defined by configure.in:
748 WORDSIZE = @wordsize@
749 ALL_BACKENDS = @all_backends@
750 BFD_BACKENDS = @bfd_backends@
751 BFD_MACHINES = @bfd_machines@
752 TDEFAULTS = @tdefaults@
753 HAVEVECS = @havevecs@
755 INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) \
756 $(HAVEVECS) @INCINTL@
758 # C source files that correspond to .o's.
760 $(BFD32_LIBS_CFILES) \
761 $(BFD64_LIBS_CFILES) \
762 $(ALL_MACHINES_CFILES) \
763 $(BFD32_BACKENDS_CFILES) \
764 $(BFD64_BACKENDS_CFILES) \
765 $(OPTIONAL_BACKENDS_CFILES)
768 elf32-aarch64.c elf64-aarch64.c \
769 elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c
771 CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
773 ## This is a list of all .h files which are in the source tree.
775 aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
776 elf-bfd.h elf-hppa.h elf-linux-psinfo.h elf32-hppa.h \
777 elf64-hppa.h elfcode.h elfcore.h \
778 freebsd.h genlink.h go32stub.h \
779 libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
780 libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
781 netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
782 pef.h pef-traceback.h peicode.h som.h version.h \
785 ## ... and all .h files which are in the build tree.
787 bfdver.h elf32-target.h elf64-target.h targmatch.h bfd_stdint.h
789 # Ensure they are built early:
790 BUILT_SOURCES = $(BUILD_HFILES)
792 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
794 SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
795 BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
797 po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
798 for file in $(SRC_POTFILES); do echo $$file; done \
799 | LC_ALL=C sort > tmp.src \
800 && mv tmp.src $(srcdir)/po/SRC-POTFILES.in
802 po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
803 for file in $(BLD_POTFILES); do echo $$file; done \
804 | LC_ALL=C sort > tmp.bld \
805 && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
809 # Various kinds of .o files to put in libbfd.a:
810 # BFD_BACKENDS Routines the configured targets need.
811 # BFD_MACHINES Architecture-specific routines the configured targets need.
812 # COREFILE Core file routines for a native configuration
813 # bfd64_libs Routines for 64bit support
814 OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@
816 stamp-ofiles: Makefile
819 for i in $(OFILES) ; do \
826 $(SHELL) $(srcdir)/../move-if-change tofiles ofiles
829 ofiles: stamp-ofiles ; @true
831 # Since BFD64_LIBS is optional and we can't have substitution in
832 # libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
833 # However, list all sources in EXTRA_libbfd_la_SOURCES so the
834 # dependency tracking fragments are picked up in the Makefile.
835 libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
836 EXTRA_libbfd_la_SOURCES = $(CFILES)
837 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
838 libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL)
839 libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
841 # libtool will build .libs/libbfd.a. We create libbfd.a in the build
842 # directory so that we don't have to convert all the programs that use
843 # libbfd.a simultaneously. This is a hack which should be removed if
844 # everything else starts using libtool. FIXME.
846 noinst_LIBRARIES = libbfd.a
850 libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
851 if [ -f $$libtooldir/libbfd.a ]; then \
852 cp $$libtooldir/libbfd.a libbfd.tmp; \
853 $(RANLIB) libbfd.tmp; \
854 $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
858 libbfd.a: stamp-lib ; @true
860 # This file holds an array associating configuration triplets and
861 # vector names. It is built from config.bfd. It is not compiled by
862 # itself, but is included by targets.c.
863 targmatch.h: config.bfd targmatch.sed
865 sed -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
866 mv -f targmatch.new targmatch.h
868 # When compiling archures.c and targets.c, supply the default target
869 # info from configure.
871 targets.lo: targets.c Makefile
873 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
874 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
877 source='targets.c' object='$@' libtool=yes @AMDEPBACKSLASH@
878 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
880 $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
883 archures.lo: archures.c Makefile
885 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
886 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
889 source='archures.c' object='$@' libtool=yes @AMDEPBACKSLASH@
890 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
892 $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
895 dwarf2.lo: dwarf2.c Makefile
897 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
898 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
901 source='dwarf2.c' object='$@' libtool=yes @AMDEPBACKSLASH@
902 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
904 $(LTCOMPILE) -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
907 elf32-target.h : elfxx-target.h
909 sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
910 mv -f elf32-target.new elf32-target.h
912 elf64-target.h : elfxx-target.h
914 sed -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new
915 mv -f elf64-target.new elf64-target.h
917 elf32-aarch64.c : elfnn-aarch64.c
918 rm -f elf32-aarch64.c
919 echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf32-aarch64.new
920 sed -e s/NN/32/g < $(srcdir)/elfnn-aarch64.c >> elf32-aarch64.new
921 mv -f elf32-aarch64.new elf32-aarch64.c
923 elf64-aarch64.c : elfnn-aarch64.c
924 rm -f elf64-aarch64.c
925 echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf64-aarch64.new
926 sed -e s/NN/64/g < $(srcdir)/elfnn-aarch64.c >> elf64-aarch64.new
927 mv -f elf64-aarch64.new elf64-aarch64.c
929 elf32-ia64.c : elfnn-ia64.c
931 sed -e s/NN/32/g < $(srcdir)/elfnn-ia64.c > elf32-ia64.new
932 mv -f elf32-ia64.new elf32-ia64.c
934 elf64-ia64.c : elfnn-ia64.c
936 sed -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new
937 mv -f elf64-ia64.new elf64-ia64.c
939 peigen.c : peXXigen.c
941 sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new
942 mv -f peigen.new peigen.c
944 pepigen.c : peXXigen.c
946 sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new
947 mv -f pepigen.new pepigen.c
949 pex64igen.c: peXXigen.c
951 sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new
952 mv -f pex64igen.new pex64igen.c
954 BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
955 LOCAL_H_DEPS= libbfd.h sysdep.h config.h
961 $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
963 host-aout.lo: Makefile
965 # The following program can be used to generate a simple config file
966 # which can be folded into an h-XXX file for a new host, with some editing.
967 aout-params.h: gen-aout
968 ./gen-aout host > aout-params.h
969 gen-aout: $(srcdir)/gen-aout.c Makefile
970 $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
972 $(BFD_H): stmp-bfd-h ; @true
974 stmp-bfd-h: bfd-in3.h
976 cp bfd-in3.h bfd-tmp.h
977 $(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
981 BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
982 reloc.c syms.c bfd.c bfdio.c bfdwin.c \
983 archive.c corefile.c targets.c format.c compress.c
984 BFD64_H_FILES = archive64.c
985 LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \
986 cache.c reloc.c archures.c elf.c
987 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
989 # Could really use a "copy-if-change"...
991 (cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
992 cp $(bfddocdir)/bfd.h bfd-in2.h-new
993 $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
994 cp $(bfddocdir)/libbfd.h libbfd.h-new
995 $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
996 cp $(bfddocdir)/libcoff.h libcoff.h-new
997 $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
999 # We only rebuild the header files automatically if we have been
1000 # configured with --enable-maintainer-mode.
1002 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
1003 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
1004 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
1005 cp $(bfddocdir)/bfd.h bfd-in2.h-new
1006 $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
1009 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
1010 stmp-lbfd-h: $(LIBBFD_H_FILES)
1011 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
1012 cp $(bfddocdir)/libbfd.h libbfd.h-new
1013 $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
1016 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
1017 stmp-lcoff-h: $(LIBCOFF_H_FILES)
1018 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
1019 cp $(bfddocdir)/libcoff.h libcoff.h-new
1020 $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
1023 MOSTLYCLEANFILES = ofiles stamp-ofiles
1025 CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
1026 stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
1028 DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
1030 bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
1032 @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
1033 bfd_version_string="\"$(VERSION)\"" ;\
1034 bfd_soversion="$(VERSION)" ;\
1035 bfd_version_package="\"$(PKGVERSION)\"" ;\
1036 report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
1037 if test "x$(RELEASE)" = x ; then \
1038 bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
1039 bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
1040 bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
1042 sed -e "s,@bfd_version@,$$bfd_version," \
1043 -e "s,@bfd_version_string@,$$bfd_version_string," \
1044 -e "s,@bfd_version_package@,$$bfd_version_package," \
1045 -e "s,@report_bugs_to@,$$report_bugs_to," \
1046 < $(srcdir)/version.h > $@; \
1047 echo "$${bfd_soversion}" > libtool-soversion
1049 # Disable -Werror, if it has been enabled, since coffswap.h won't
1050 # compile with gcc 4.5 and above.
1051 coff-tic4x.lo: coff-tic4x.c
1052 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
1053 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
1054 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
1055 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1056 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< $(NO_WERROR)
1058 coff-tic54x.lo: coff-tic54x.c
1059 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(NO_WERROR)
1060 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
1061 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
1062 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1063 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< $(NO_WERROR)