Automate generate on man pages
[deliverable/binutils-gdb.git] / ld / Makefile.am
index 2bd385001555e02df6572f8d37ec1b3645687541..2cdbf7846fcb3cc28e5c7d84101801c79daf5246 100644 (file)
@@ -41,6 +41,13 @@ MKDEP = gcc -MM
 # What version of the manual to build
 DOCVER = gen
 
+# Options to extract the man page from ld.texinfo
+MANCONF = -Dman
+
+TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl
+
+POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1
+
 #stuff for self hosting (can be overridden in config file).
 HOSTING_CRT0 = @HOSTING_CRT0@
 HOSTING_LIBS = @HOSTING_LIBS@
@@ -110,7 +117,6 @@ ALL_EMULATIONS = \
        earmcoff.o \
        earmelf.o \
        earmelf_linux.o \
-       earmelf_linux26.o \
        earmelf_oabi.o \
        earmnbsd.o \
        earmpe.o \
@@ -153,6 +159,8 @@ ALL_EMULATIONS = \
        eelf32ppcsim.o \
        eelf_i386.o \
        eelf_i386_be.o \
+       eelf_i386_chaos.o \
+       eelf_s390.o \
        egld960.o \
        egld960coff.o \
        eh8300.o \
@@ -207,6 +215,7 @@ ALL_EMULATIONS = \
        enews.o \
        ens32knbsd.o \
        epc532macha.o \
+       epdp11.o \
        epjelf.o \
        epjlelf.o \
        eppcmacos.o \
@@ -240,7 +249,10 @@ ALL_EMULATIONS = \
        ez8002.o
 
 ALL_64_EMULATIONS = \
+       eelf64_aix.o \
        eelf64_ia64.o \
+       eelf_x86_64.o \
+       eelf64_s390.o \
        eelf64_sparc.o \
        eelf64alpha.o \
        eelf64bmip.o \
@@ -300,7 +312,7 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${exec_prefix} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
 GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 @TDIRS@
 
@@ -330,10 +342,6 @@ earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
-earmelf_linux26.c: $(srcdir)/emulparams/armelf_linux26.sh \
-  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
-  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
-       ${GENSCRIPTS} armelf_linux26 "$(tdir_armelf_linux26)"
 earmaoutb.c:   $(srcdir)/emulparams/armaoutb.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
@@ -486,9 +494,15 @@ eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
 eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)"
+eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+       ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)"
 eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)"
+eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+       ${GENSCRIPTS} elf64_s390 "$(tdir_elf64_s390)"
 eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
@@ -498,9 +512,18 @@ eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
 eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
+eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+       ${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
 eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
+eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+       ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
+eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+       ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"
 egld960.c: $(srcdir)/emulparams/gld960.sh \
   $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} gld960 "$(tdir_gld960)"
@@ -615,7 +638,8 @@ em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
   $(srcdir)/emultempl/m68kcoff.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
 em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
-  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
 em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
   $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
@@ -671,6 +695,9 @@ ens32knbsd.c:       $(srcdir)/emulparams/ns32knbsd.sh \
 epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)"
+epdp11.c: $(srcdir)/emulparams/pdp11.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+       ${GENSCRIPTS} pdp11 "$(tdir_pdp11)"
 epjelf.c: $(srcdir)/emulparams/pjelf.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} pjelf "$(tdir_pjelf)"
@@ -880,6 +907,17 @@ ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
        TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
          MAKEINFO="$(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc" $(TEXI2DVI) $(srcdir)/ld.texinfo
 
+# Build the man page from the texinfo file
+# The sed command removes the no-adjust Nroff command so that
+# the man output looks standard.
+$(srcdir)/ld.1: $(srcdir)/ld.texinfo
+       touch $(srcdir)/ld.1
+       -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
+       -($(POD2MAN) ld.pod | \
+               sed -e '/^.if n .na/d' > $(srcdir)/ld.1.T$$$$ && \
+               mv -f $(srcdir)/ld.1.T$$$$ $(srcdir)/ld.1) || \
+               (rm -f $(srcdir)/ld.1.T$$$$ && exit 1)
+
 MAINTAINERCLEANFILES = ldver.texi
 
 # We want to reconfigure if configure.host or configure.tgt changes.
@@ -920,7 +958,7 @@ install-data-local:
 LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
 diststuff: $(LDDISTSTUFF) info
 
-DISTCLEANFILES = tdirs site.exp site.bak
+DISTCLEANFILES = tdirs site.exp site.bak stringify.sed
 distclean-local:
        rm -rf ldscripts
 
@@ -1009,9 +1047,9 @@ ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
 lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
-  $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
-  ldmain.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h \
-  ldfile.h ldver.h ldemul.h $(INCDIR)/demangle.h
+  $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \
+  ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
+  ldver.h ldemul.h $(INCDIR)/demangle.h
 mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h sysdep.h \
   config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
   ldexp.h ldlang.h ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h
This page took 0.026704 seconds and 4 git commands to generate.