* Makefile.am (config.status): New target.
[binutils-gdb.git] / bfd / Makefile.am
index ad7d6463cdf42935dd170973116d9868d390fae6..ada44bd5d549a9c9448a14549c78386a38264d38 100644 (file)
@@ -1,10 +1,12 @@
 ## Process this file with automake to generate Makefile.in
 
+AUTOMAKE_OPTIONS = cygnus
+
 INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 DEP = mkdep
 
-SUBDIRS = doc
+SUBDIRS = doc po
 
 docdir = doc
 
@@ -13,13 +15,7 @@ lib_LTLIBRARIES = libbfd.la
 # bfd.h goes here, for now
 BFD_H = bfd.h
 
-# Some of these files should be in BFD*_BACKENDS below, but some programs
-# won't link without them.  So, in order for some of the minimal-bfd
-# hacks to work, they're also included here for now.
-#      gdb: elf.o
-#      objdump: elf.o
-#
-# Also, Jim Kingdon notes:
+# Jim Kingdon notes:
 # Writing S-records should be included in all (or at least most)
 # *-*-coff, *-*-aout, etc., configurations, because people will want to
 # be able to use objcopy to create S-records.  (S-records are not useful
@@ -30,22 +26,20 @@ BFD_LIBS = \
        archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \
        format.lo init.lo libbfd.lo opncls.lo reloc.lo \
        section.lo syms.lo targets.lo hash.lo linker.lo \
-       elf.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo
+       srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo
 
 BFD_LIBS_CFILES = \
        archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
        format.c init.c libbfd.c opncls.c reloc.c \
        section.c syms.c targets.c hash.c linker.c \
-       elf.c srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c
+       srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c
 
 # This list is alphabetized to make it easier to keep in sync
 # with the decls and initializer in archures.c.
 ALL_MACHINES = \
        cpu-a29k.lo \
        cpu-alpha.lo \
-       $(start-sanitize-arc) \
        cpu-arc.lo \
-       $(end-sanitize-arc) \
        cpu-arm.lo \
        cpu-d10v.lo \
        $(start-sanitize-d30v) \
@@ -68,12 +62,11 @@ ALL_MACHINES = \
        cpu-rs6000.lo \
        cpu-sh.lo \
        cpu-sparc.lo \
+       cpu-tic30.lo \
        $(start-sanitize-tic80) \
        cpu-tic80.lo \
        $(end-sanitize-tic80) \
-       $(start-sanitize-v850) \
        cpu-v850.lo \
-       $(end-sanitize-v850) \
        cpu-vax.lo \
        cpu-we32k.lo \
        cpu-w65.lo \
@@ -82,6 +75,7 @@ ALL_MACHINES = \
 ALL_MACHINES_CFILES = \
        cpu-a29k.c \
        cpu-alpha.c \
+       cpu-arc.c \
        cpu-arm.c \
        cpu-h8300.c \
        cpu-h8500.c \
@@ -100,6 +94,8 @@ ALL_MACHINES_CFILES = \
        cpu-rs6000.c \
        cpu-sh.c \
        cpu-sparc.c \
+       cpu-tic30.c \
+       cpu-v850.c \
        cpu-vax.c \
        cpu-we32k.c \
        cpu-w65.c \
@@ -112,6 +108,7 @@ BFD32_BACKENDS = \
        aout-arm.lo \
        aout-ns32k.lo \
        aout-sparcle.lo \
+       aout-tic30.lo \
        aout0.lo \
        aout32.lo \
        bout.lo \
@@ -135,8 +132,9 @@ BFD32_BACKENDS = \
        coff-rs6000.lo \
        coff-sh.lo \
        coff-sparc.lo \
-       coff-stubgo32.lo \
+       coff-stgo32.lo \
        coff-svm68k.lo \
+       coff-tic30.lo \
        $(start-sanitize-tic80) \
        coff-tic80.lo \
        $(end-sanitize-tic80) \
@@ -145,11 +143,11 @@ BFD32_BACKENDS = \
        coff-w65.lo \
        coff-z8k.lo \
        cofflink.lo \
+       dwarf2.lo \
        ecoff.lo \
        ecofflink.lo \
-       $(start-sanitize-arc) \
+       elf.lo \
        elf32-arc.lo \
-       $(end-sanitize-arc) \
        elf32-d10v.lo \
        $(start-sanitize-d30v) \
        elf32-d30v.lo \
@@ -167,9 +165,7 @@ BFD32_BACKENDS = \
        elf32-ppc.lo \
        elf32-sh.lo \
        elf32-sparc.lo \
-       $(start-sanitize-v850) \
        elf32-v850.lo \
-       $(end-sanitize-v850) \
        elf32.lo \
        elflink.lo \
        hp300bsd.lo \
@@ -214,7 +210,7 @@ BFD32_BACKENDS = \
        sparclynx.lo \
        sparcnetbsd.lo \
        sunos.lo \
-       tekhex.lo \
+       vaxnetbsd.lo \
        versados.lo \
        xcofflink.lo
 
@@ -223,6 +219,7 @@ BFD32_BACKENDS_CFILES = \
        aout-arm.c \
        aout-ns32k.c \
        aout-sparcle.c \
+       aout-tic30.c \
        aout0.c \
        aout32.c \
        bout.c \
@@ -246,15 +243,20 @@ BFD32_BACKENDS_CFILES = \
        coff-rs6000.c \
        coff-sh.c \
        coff-sparc.c \
-       coff-stubgo32.c \
+       coff-stgo32.c \
        coff-svm68k.c \
+       coff-tic30.c \
        coff-u68k.c \
        coff-we32k.c \
        coff-w65.c \
        coff-z8k.c \
        cofflink.c \
+       dwarf2.c \
        ecoff.c \
        ecofflink.c \
+       elf.c \
+       elf32-arc.c \
+       elf32-d10v.c \
        elf32-gen.c \
        elf32-hppa.c \
        elf32-i386.c \
@@ -268,6 +270,7 @@ BFD32_BACKENDS_CFILES = \
        elf32-ppc.c \
        elf32-sh.c \
        elf32-sparc.c \
+       elf32-v850.c \
        elf32.c \
        elflink.c \
        hp300bsd.c \
@@ -312,7 +315,7 @@ BFD32_BACKENDS_CFILES = \
        sparclynx.c \
        sparcnetbsd.c \
        sunos.c \
-       tekhex.c \
+       vaxnetbsd.c \
        versados.c \
        xcofflink.c
 
@@ -378,7 +381,7 @@ BFD_BACKENDS = @bfd_backends@
 BFD_MACHINES = @bfd_machines@
 TDEFAULTS = @tdefaults@
 
-INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES)
+INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
 
 # C source files that correspond to .o's.
 CFILES = \
@@ -388,13 +391,25 @@ CFILES = \
        $(BFD64_BACKENDS_CFILES) \
        $(OPTIONAL_BACKENDS_CFILES)
 
-HFILES = \
+## This is a list of all .h files which are in the source tree.
+SOURCE_HFILES = \
        aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
-       ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
+       ecoffswap.h elf32-hppa.h \
        elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
        libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
-       libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
-       targmatch.h
+       libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h
+
+HFILES = \
+       elf32-target.h elf64-target.h targmatch.h \
+       $(SOURCE_HFILES)
+
+POTFILES = $(CFILES) $(SOURCE_HFILES)
+
+po/POTFILES.in: @MAINT@ Makefile
+       for file in $(POTFILES); do echo $$file; done | sort > tmp \
+         && mv tmp $(srcdir)/po/POTFILES.in
+
+diststuff: info
 
 # Various kinds of .o files to put in libbfd.a:
 # BFD_BACKENDS Routines the configured targets need.
@@ -419,7 +434,8 @@ ofiles: stamp-ofiles ; @true
 
 libbfd_la_SOURCES = $(BFD_LIBS_CFILES)
 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
-libbfd_la_LIBADD = `cat ofiles`
+libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
+libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
 
 # libtool will build .libs/libbfd.a.  We create libbfd.a in the build
 # directory so that we don't have to convert all the programs that use
@@ -427,10 +443,13 @@ libbfd_la_LIBADD = `cat ofiles`
 # everything else starts using libtool.  FIXME.
 
 noinst_LIBRARIES = libbfd.a
+libbfd_a_SOURCES =
 
 stamp-lib: libbfd.la
-       cp .libs/libbfd.a libbfd.tmp
-       $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a
+       if [ -f .libs/libbfd.a ]; then \
+         cp .libs/libbfd.a libbfd.tmp; \
+         $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
+       else true; fi
        touch stamp-lib
 
 libbfd.a: stamp-lib ; @true
@@ -525,14 +544,19 @@ aout-params.h: gen-aout
 gen-aout: $(srcdir)/gen-aout.c Makefile
        $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
 
-$(BFD_H): stmp-bfd.h ; @true
+$(BFD_H): stmp-bfd-h ; @true
 
-stmp-bfd.h: bfd-in3.h
+stmp-bfd-h: bfd-in3.h
        rm -f bfd-tmp.h
        cp bfd-in3.h bfd-tmp.h
        $(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
        rm -f bfd-tmp.h
-       touch stmp-bfd.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 archive.c corefile.c targets.c format.c
+LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
+LIBCOFF_H_FILES = libcoff-in.h coffcode.h
 
 # Could really use a "copy-if-change"...
 headers:
@@ -544,35 +568,35 @@ headers:
        cp $(docdir)/libcoff.h libcoff.h-new
        $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 
-# The rules for the generated header files are here so that people can
-# type `make bfd-in2.h' if they remove it.  They are not run by default.
-$(srcdir)/bfd-in2.h:
-       (cd $(docdir); $(MAKE) bfd.h $(FLAGS_TO_PASS))
+# We only rebuild the header files automatically if we have been
+# configured with --enable-maintainer-mode.
+
+$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
+stmp-bin2-h: $(BFD_H_FILES)
+       (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
        cp $(docdir)/bfd.h bfd-in2.h-new
        $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-$(srcdir)/libbfd.h:
-       (cd $(docdir); $(MAKE) libbfd.h $(FLAGS_TO_PASS))
+       touch stmp-bin2-h
+
+$(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
+stmp-lbfd-h: $(LIBBFD_H_FILES)
+       (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
        cp $(docdir)/libbfd.h libbfd.h-new
        $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-$(srcdir)/libcoff.h:
-       (cd $(docdir); $(MAKE) libcoff.h $(FLAGS_TO_PASS))
+       touch stmp-lbfd-h
+
+$(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
+stmp-lcoff-h: $(LIBCOFF_H_FILES)
+       (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
        cp $(docdir)/libcoff.h libcoff.h-new
        $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+       touch stmp-lcoff-h
 
 MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \
        targmatch.h
 
-CLEANFILES = bfd.h dep.sed stmp-bfd.h .dep .dep1 libbfd.a stamp-lib
-
-start-sanitize-arc:
-elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
-  $(INCDIR)/elf/arc.h elf32-target.h
-end-sanitize-arc:
-
-elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
-  elf32-target.h
+CLEANFILES = bfd.h dep.sed stmp-bfd-h .dep .dep1 libbfd.a stamp-lib \
+       stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
 start-sanitize-d30v:
 elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \
@@ -580,13 +604,6 @@ elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \
   elf32-target.h
 end-sanitize-d30v:
 
-start-sanitize-v850:
-cpu-v850.lo: cpu-v850.c
-elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \
-  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  elf32-target.h
-end-sanitize-v850:
-
 start-sanitize-tic80:
 cpu-tic80.lo: cpu-tic80.c
 coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h elf-bfd.h \
@@ -629,6 +646,7 @@ stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def
 cpu-a29k.lo: cpu-a29k.c
 cpu-alpha.lo: cpu-alpha.c
+cpu-arc.lo: cpu-arc.c
 cpu-arm.lo: cpu-arm.c
 cpu-h8300.lo: cpu-h8300.c
 cpu-h8500.lo: cpu-h8500.c
@@ -647,6 +665,8 @@ cpu-powerpc.lo: cpu-powerpc.c
 cpu-rs6000.lo: cpu-rs6000.c
 cpu-sh.lo: cpu-sh.c
 cpu-sparc.lo: cpu-sparc.c
+cpu-tic30.lo: cpu-tic30.c
+cpu-v850.lo: cpu-v850.c
 cpu-vax.lo: cpu-vax.c
 cpu-we32k.lo: cpu-we32k.c
 cpu-w65.lo: cpu-w65.c
@@ -663,6 +683,9 @@ aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \
   libaout.h aoutf1.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
   aout-target.h
+aout-tic30.lo: aout-tic30.c libaout.h $(INCDIR)/bfdlink.h \
+  $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
+  $(INCDIR)/aout/ar.h aoutx.h
 aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
   $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
@@ -723,13 +746,15 @@ coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
 coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \
   $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
   coffcode.h coffswap.h
-coff-stubgo32.lo: coff-stubgo32.c coff-i386.c $(INCDIR)/coff/i386.h \
+coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/coff/i386.h \
   $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \
   libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \
   go32stub.h
 coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
   $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
   coffcode.h coffswap.h
+coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \
+  $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
 coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
   $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
   coffcode.h coffswap.h
@@ -742,6 +767,9 @@ coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \
   $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
 cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
   libcoff.h
+dwarf2.lo: dwarf2.c elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+  $(INCDIR)/elf/dwarf2.h
 ecoff.lo: ecoff.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/ar.h \
   $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
   libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/coff/internal.h \
@@ -751,6 +779,12 @@ ecofflink.lo: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
   libcoff.h libecoff.h
+elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+  $(INCDIR)/elf/arc.h elf32-target.h
+elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+  elf32-target.h
 elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elf32-target.h
@@ -794,6 +828,9 @@ elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/elf/sparc.h elf32-target.h
+elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/elf/v850.h elf32-target.h
 elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/fnmatch.h elfcore.h elflink.h
@@ -913,6 +950,9 @@ sparcnetbsd.lo: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
 sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \
   $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
   $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
+vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+  aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+  $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
 versados.lo: versados.c $(INCDIR)/libiberty.h
 xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
   libcoff.h