1 ## Process this file with automake to generate Makefile.in
3 AUTOMAKE_OPTIONS = 1.11 no-dist foreign
4 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
6 # Uncomment the following line when doing a release.
9 INCDIR = $(srcdir)/../include
10 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
18 bfdlibdir = @bfdlibdir@
19 bfdincludedir = @bfdincludedir@
20 bfdlib_LTLIBRARIES = libbfd.la
21 bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
23 # Empty these so that the respective installation directories will not be created.
26 rpath_bfdlibdir = @bfdlibdir@
27 noinst_LTLIBRARIES = libbfd.la
28 libbfd_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
31 WARN_CFLAGS = @WARN_CFLAGS@
32 NO_WERROR = @NO_WERROR@
33 AM_CFLAGS = $(WARN_CFLAGS)
34 AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
39 # bfd.h goes here, for now
43 # Writing S-records should be included in all (or at least most)
44 # *-*-coff, *-*-aout, etc., configurations, because people will want to
45 # be able to use objcopy to create S-records. (S-records are not useful
46 # for the debugger, so if you are downloading things as S-records you
47 # need two copies of the executable, one to download and one for the
50 archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
51 cache.lo coffgen.lo corefile.lo \
52 format.lo init.lo libbfd.lo opncls.lo reloc.lo \
53 section.lo syms.lo targets.lo hash.lo linker.lo \
54 srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
55 merge.lo dwarf2.lo simple.lo compress.lo verilog.lo
57 BFD64_LIBS = archive64.lo
60 archive.c archures.c bfd.c bfdio.c bfdwin.c \
61 cache.c coffgen.c corefile.c \
62 format.c init.c libbfd.c opncls.c reloc.c \
63 section.c syms.c targets.c hash.c linker.c \
64 srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
65 merge.c dwarf2.c simple.c compress.c verilog.c
67 BFD64_LIBS_CFILES = archive64.c
69 # This list is alphabetized to make it easier to keep in sync
70 # with the decls and initializer in archures.c.
142 ALL_MACHINES_CFILES = \
213 # The .o files needed by all of the 32 bit vectors that are configured into
214 # target_vector in targets.c if configured with --enable-targets=all.
301 elf32-microblaze.lo \
311 elf32-sh-symbian.lo \
398 BFD32_BACKENDS_CFILES = \
580 # The .o files needed by all of the 64 bit vectors that are configured into
581 # target_vector in targets.c if configured with --enable-targets=all
582 # and --enable-64-bit-bfd.
583 # elf32-ia64.c requires a 64-bit bfd_vma, and hence can not be put in
617 BFD64_BACKENDS_CFILES = \
645 OPTIONAL_BACKENDS = \
655 OPTIONAL_BACKENDS_CFILES = \
665 # We want to rerun configure if configure.in, config.bfd or
666 # configure.host change. configure.in is needed since the version
667 # number in Makefile comes from configure.in.
668 CONFIG_STATUS_DEPENDENCIES = \
669 $(srcdir)/configure.in \
670 $(srcdir)/config.bfd \
671 $(srcdir)/configure.host
673 # These are defined by configure.in:
674 WORDSIZE = @wordsize@
675 ALL_BACKENDS = @all_backends@
676 BFD_BACKENDS = @bfd_backends@
677 BFD_MACHINES = @bfd_machines@
678 TDEFAULTS = @tdefaults@
680 INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) @INCINTL@
682 # C source files that correspond to .o's.
684 $(BFD32_LIBS_CFILES) \
685 $(BFD64_LIBS_CFILES) \
686 $(ALL_MACHINES_CFILES) \
687 $(BFD32_BACKENDS_CFILES) \
688 $(BFD64_BACKENDS_CFILES) \
689 $(OPTIONAL_BACKENDS_CFILES)
692 elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c
694 CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
696 ## This is a list of all .h files which are in the source tree.
698 aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
699 elf-bfd.h elf-hppa.h elf32-hppa.h \
700 elf64-hppa.h elfcode.h elfcore.h \
701 freebsd.h genlink.h go32stub.h \
702 libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
703 libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
704 netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
705 pef.h pef-traceback.h peicode.h som.h version.h \
706 vms.h xcoff-target.h xsym.h
708 ## ... and all .h files which are in the build tree.
710 bfdver.h elf32-target.h elf64-target.h targmatch.h bfd_stdint.h
712 # Ensure they are built early:
713 BUILT_SOURCES = $(BUILD_HFILES)
715 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
717 SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
718 BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
720 po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
721 for file in $(SRC_POTFILES); do echo $$file; done \
722 | LC_ALL=C sort > tmp.src \
723 && mv tmp.src $(srcdir)/po/SRC-POTFILES.in
725 po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
726 for file in $(BLD_POTFILES); do echo $$file; done \
727 | LC_ALL=C sort > tmp.bld \
728 && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
732 # Various kinds of .o files to put in libbfd.a:
733 # BFD_BACKENDS Routines the configured targets need.
734 # BFD_MACHINES Architecture-specific routines the configured targets need.
735 # COREFILE Core file routines for a native configuration
736 # bfd64_libs Routines for 64bit support
737 OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@
739 stamp-ofiles: Makefile
742 for i in $(OFILES) ; do \
749 $(SHELL) $(srcdir)/../move-if-change tofiles ofiles
752 ofiles: stamp-ofiles ; @true
754 # Since BFD64_LIBS is optional and we can't have substitution in
755 # libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
756 # However, list all sources in EXTRA_libbfd_la_SOURCES so the
757 # dependency tracking fragments are picked up in the Makefile.
758 libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
759 EXTRA_libbfd_la_SOURCES = $(CFILES)
760 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
761 libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL)
762 libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
764 # libtool will build .libs/libbfd.a. We create libbfd.a in the build
765 # directory so that we don't have to convert all the programs that use
766 # libbfd.a simultaneously. This is a hack which should be removed if
767 # everything else starts using libtool. FIXME.
769 noinst_LIBRARIES = libbfd.a
773 libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
774 if [ -f $$libtooldir/libbfd.a ]; then \
775 cp $$libtooldir/libbfd.a libbfd.tmp; \
776 $(RANLIB) libbfd.tmp; \
777 $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
781 libbfd.a: stamp-lib ; @true
783 # This file holds an array associating configuration triplets and
784 # vector names. It is built from config.bfd. It is not compiled by
785 # itself, but is included by targets.c.
786 targmatch.h: config.bfd targmatch.sed
788 sed -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
789 mv -f targmatch.new targmatch.h
791 # When compiling archures.c and targets.c, supply the default target
792 # info from configure.
794 targets.lo: targets.c Makefile
796 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
797 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
800 source='targets.c' object='$@' libtool=yes @AMDEPBACKSLASH@
801 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
803 $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/targets.c
806 archures.lo: archures.c Makefile
808 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
809 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
812 source='archures.c' object='$@' libtool=yes @AMDEPBACKSLASH@
813 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
815 $(LTCOMPILE) -c -o $@ $(TDEFAULTS) $(srcdir)/archures.c
818 dwarf2.lo: dwarf2.c Makefile
820 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
821 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
824 source='dwarf2.c' object='$@' libtool=yes @AMDEPBACKSLASH@
825 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
827 $(LTCOMPILE) -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
830 elf32-target.h : elfxx-target.h
832 sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
833 mv -f elf32-target.new elf32-target.h
835 elf64-target.h : elfxx-target.h
837 sed -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new
838 mv -f elf64-target.new elf64-target.h
840 elf32-ia64.c : elfxx-ia64.c
842 sed -e s/NN/32/g < $(srcdir)/elfxx-ia64.c > elf32-ia64.new
843 mv -f elf32-ia64.new elf32-ia64.c
845 elf64-ia64.c : elfxx-ia64.c
847 sed -e s/NN/64/g < $(srcdir)/elfxx-ia64.c > elf64-ia64.new
848 mv -f elf64-ia64.new elf64-ia64.c
850 peigen.c : peXXigen.c
852 sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new
853 mv -f peigen.new peigen.c
855 pepigen.c : peXXigen.c
857 sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new
858 mv -f pepigen.new pepigen.c
860 pex64igen.c: peXXigen.c
862 sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new
863 mv -f pex64igen.new pex64igen.c
865 BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
866 LOCAL_H_DEPS= libbfd.h sysdep.h config.h
872 $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
874 host-aout.lo: Makefile
876 # The following program can be used to generate a simple config file
877 # which can be folded into an h-XXX file for a new host, with some editing.
878 aout-params.h: gen-aout
879 ./gen-aout host > aout-params.h
880 gen-aout: $(srcdir)/gen-aout.c Makefile
881 $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
883 $(BFD_H): stmp-bfd-h ; @true
885 stmp-bfd-h: bfd-in3.h
887 cp bfd-in3.h bfd-tmp.h
888 $(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
892 BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
893 reloc.c syms.c bfd.c bfdio.c bfdwin.c \
894 archive.c corefile.c targets.c format.c compress.c
895 BFD64_H_FILES = archive64.c
896 LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \
897 cache.c reloc.c archures.c elf.c
898 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
900 # Could really use a "copy-if-change"...
902 (cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
903 cp $(bfddocdir)/bfd.h bfd-in2.h-new
904 $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
905 cp $(bfddocdir)/libbfd.h libbfd.h-new
906 $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
907 cp $(bfddocdir)/libcoff.h libcoff.h-new
908 $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
910 # We only rebuild the header files automatically if we have been
911 # configured with --enable-maintainer-mode.
913 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
914 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
915 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
916 cp $(bfddocdir)/bfd.h bfd-in2.h-new
917 $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
920 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
921 stmp-lbfd-h: $(LIBBFD_H_FILES)
922 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
923 cp $(bfddocdir)/libbfd.h libbfd.h-new
924 $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
927 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
928 stmp-lcoff-h: $(LIBCOFF_H_FILES)
929 (cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
930 cp $(bfddocdir)/libcoff.h libcoff.h-new
931 $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
934 MOSTLYCLEANFILES = ofiles stamp-ofiles
936 CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
937 stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
939 DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
941 bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
943 @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
944 bfd_version_string="\"$(VERSION)\"" ;\
945 bfd_soversion="$(VERSION)" ;\
946 bfd_version_package="\"$(PKGVERSION)\"" ;\
947 report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
948 if test "x$(RELEASE)" = x ; then \
949 bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
950 bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
951 bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
953 sed -e "s,@bfd_version@,$$bfd_version," \
954 -e "s,@bfd_version_string@,$$bfd_version_string," \
955 -e "s,@bfd_version_package@,$$bfd_version_package," \
956 -e "s,@report_bugs_to@,$$report_bugs_to," \
957 < $(srcdir)/version.h > $@; \
958 echo "$${bfd_soversion}" > libtool-soversion