home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / gdb-4.14-src.lha / gdb-4.14 / gdb / doc / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-03-04  |  10.3 KB  |  332 lines

  1. ##Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2.  
  3. # Makefile for GDB documentation.
  4. # This file is part of GDB.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (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.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. srcdir = .
  19.  
  20. prefix = /usr/local
  21.  
  22. infodir = $(prefix)/info
  23.  
  24. SHELL = /bin/sh
  25.  
  26. INSTALL = install -c
  27. INSTALL_PROGRAM = $(INSTALL)
  28. INSTALL_DATA = $(INSTALL)
  29.  
  30. # main GDB source directory
  31. gdbdir = $(srcdir)/..
  32.  
  33. # where to find texinfo; GDB dist should include a recent one
  34. TEXIDIR=${gdbdir}/../texinfo
  35.  
  36. # where to find makeinfo, preferably one designed for texinfo-2
  37. MAKEINFO=makeinfo
  38.  
  39. # where to find texi2roff, ditto
  40. TEXI2ROFF=texi2roff
  41.  
  42. # Where is the source dir for the READLINE library doc?  
  43. # Traditionally readline is in .. or .
  44. READLINE_DIR = ${gdbdir}/../readline/doc
  45.  
  46. SET_TEXINPUTS = TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$$TEXINPUTS
  47.  
  48. # There may be alternate predefined collections of switches to configure
  49. # the GDB manual.  Normally this is not done in synch with the software
  50. # config system, since this choice tends to be independent; most people
  51. # want a doc config of `all' for a generic manual, regardless of sw config.
  52. DOC_CONFIG = all
  53.  
  54. # This list of sed edits will edit the GDB reference card
  55. # for what fonts and what papersize to use.
  56. # By default (NO edits applied), the refcard uses:
  57. #    - Computer Modern (CM) fonts
  58. #    - US letter paper (8.5x11in)
  59. # List some of the following files for alternative fonts and paper:
  60. #  a4rc.sed     use A4 paper (297 x 210 mm)
  61. #  psrc.sed     use PostScript fonts (Karl Berry short TeX names)
  62. # lpsrc.sed     use PostScript fonts (full PostScript names in TeX)
  63. # e.g. for A4, Postscript:  REFEDITS = a4rc.sed psrc.sed
  64. #      for A4, CM fonts:    REFEDITS = a4rc.sed
  65. #      for US, PS fonts:    REFEDITS = psrc.sed
  66. #      for default:
  67. REFEDITS =
  68.  
  69. # Don Knuth's TeX formatter
  70. TEX = tex
  71.  
  72. # auxiliary program for sorting Texinfo indices
  73. TEXINDEX = texindex
  74.  
  75. # Main GDB manual's source files
  76. SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/remote.texi
  77.  
  78. SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
  79.  
  80. SFILES_DOC = $(SFILES_LOCAL) \
  81.                 $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi
  82.  
  83. #### Host, target, and site specific Makefile fragments come in here.
  84. ###
  85.  
  86. all install:
  87.  
  88. info: gdb.info gdbint.info stabs.info
  89. dvi: gdb.dvi refcard.dvi gdbint.dvi
  90. all-doc: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi
  91.  
  92. install-info: info
  93.     for i in *.info* ; do \
  94.         $(INSTALL_DATA) $$i $(infodir)/$$i ; \
  95.     done
  96.  
  97. STAGESTUFF = *.info* gdb-all.texi GDBvn.texi
  98.  
  99. # Copy the object files from a particular stage into a subdirectory.
  100. stage1: force
  101.     -mkdir stage1
  102.     -mv $(STAGESTUFF) stage1
  103.  
  104. stage2: force
  105.     -mkdir stage2
  106.     -mv $(STAGESTUFF) stage2
  107.  
  108. stage3: force
  109.     -mkdir stage3
  110.     -mv $(STAGESTUFF) stage3
  111.  
  112. against=stage2
  113.  
  114. comparison: force
  115.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  116.  
  117. de-stage1: force
  118.     -(cd stage1 ; mv -f * ..)
  119.     -rmdir stage1
  120.  
  121. de-stage2: force
  122.     -(cd stage2 ; mv -f * ..)
  123.     -rmdir stage2
  124.  
  125. de-stage3: force
  126.     -(cd stage3 ; mv -f * ..)
  127.     -rmdir stage3
  128.  
  129. clean-info:
  130.     rm -f gdb.info* gdbint.info* stabs.info*
  131.  
  132. clean-dvi:
  133.     rm -f gdb.dvi gdbint.dvi stabs.dvi sedref.dvi
  134.  
  135. mostlyclean: clean-info clean-dvi
  136.     rm -f gdb.?? gdb.??? gdb.mm gdb.ms gdb.me
  137.     rm -f links2roff
  138.     rm -f refcard.ps lrefcard.ps refcard.log sedref.* *~
  139.     rm -f gdbint.?? gdbint.??? stabs.?? stabs.???
  140.  
  141. clean: mostlyclean
  142.     rm -f rluser.texinfo inc-hist.texi gdb-cfg.texi
  143.  
  144. distclean: clean
  145.     rm -f Makefile config.status
  146.  
  147. # GDBvn.texi and refcard.dvi are distributed, so they should not be
  148. # removed by "clean" or "distclean".
  149. realclean: distclean clean-dvi clean-info
  150.     rm -f GDBvn.texi refcard.dvi
  151.  
  152. # GDB QUICK REFERENCE (dvi output)
  153. refcard.dvi : refcard.tex $(REFEDITS)
  154.     if [ -z "$(REFEDITS)" ]; then \
  155.         cp $(srcdir)/refcard.tex sedref.tex ; \
  156.     else \
  157.         echo > tmp.sed ; \
  158.         for f in "$(REFEDITS)" ; do \
  159.             cat $(srcdir)/$$f >>tmp.sed ; done ; \
  160.         sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex ; \
  161.     fi
  162.     $(SET_TEXINPUTS) $(TEX) sedref.tex
  163.     mv sedref.dvi refcard.dvi
  164.     rm -f sedref.log sedref.tex tmp.sed
  165.  
  166. refcard.ps : refcard.dvi
  167.     dvips -t landscape refcard.dvi -o
  168.  
  169. # File to record current GDB version number (copied from main dir Makefile.in)
  170. GDBvn.texi : ${gdbdir}/Makefile.in
  171.     echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`" > ./GDBvn.new
  172.     mv GDBvn.new GDBvn.texi
  173.  
  174. # Updated atomically
  175. .PRECIOUS: GDBvn.texi
  176.  
  177. # Choose configuration for GDB manual (normally `all'; normally not tied into
  178. # `configure' script because most users prefer generic version of manual,
  179. # not one for their binary config---which may not be specifically
  180. # defined anyways).
  181. gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
  182.     ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
  183.     ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
  184.     cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
  185.  
  186. # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
  187. # If your texinfo or makeinfo don't support these, get a new texinfo release
  188. #
  189. # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
  190. #   Note that we can *generate* GDBvn.texi, but since we distribute one in the
  191. #   source directory for the benefit of people who *don't* use this makefile,
  192. #   VPATH will often tell make not to bother building it, because the one
  193. #   in the srcdir is up to date.  (if not, then make should build one here).
  194.  
  195. # GDB MANUAL: TeX dvi file
  196. gdb.dvi: ${SFILES_DOC}
  197.     if [ ! -f ./GDBvn.texi ]; then \
  198.         ln -s $(srcdir)/GDBvn.texi . || \
  199.         ln $(srcdir)/GDBvn.texi . || \
  200.         cp $(srcdir)/GDBvn.texi . ; else true; fi
  201.     $(SET_TEXINPUTS) $(TEX) gdb.texinfo
  202.     $(SET_TEXINPUTS) $(TEX) gdb.texinfo
  203.     $(TEXINDEX) gdb.??
  204.     $(SET_TEXINPUTS) $(TEX) gdb.texinfo
  205.     rm -f gdb.?? gdb.log gdb.aux gdb.toc gdb.??s
  206.  
  207. # GDB MANUAL: info file
  208. # We're using texinfo2, and older makeinfo's may not be able to
  209. # cope with all the markup.  
  210. gdb.info: ${SFILES_DOC}
  211.     $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
  212.  
  213. # GDB MANUAL: roff translations
  214. # Try to use a recent texi2roff.  v2 was put on prep in jan91.
  215. # If you want an index, see texi2roff doc for postprocessing 
  216. # and add -i to texi2roff invocations below.
  217. # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
  218. #    corresponding -e lines when later texi2roff's are current)
  219. # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
  220. # + @c's deleted explicitly because texi2roff sees texinfo commands in them
  221. # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
  222. # + @alphaenumerate is ridiculously new, turned into @enumerate
  223.  
  224. # texi2roff doesn't have a notion of include dirs, so we have to fake 
  225. # it out for gdb manual's include files---but only if not configured
  226. # in main sourcedir.
  227. links2roff: $(SFILES_INCLUDED)
  228.     if [ ! -f gdb.texinfo ]; then \
  229.         ln -s $(SFILES_INCLUDED) . || \
  230.         ln $(SFILES_INCLUDED)    . || \
  231.         cp $(SFILES_INCLUDED)    . ; \
  232.     fi
  233.     touch links2roff
  234.  
  235. #  "Readline" appendices.  Get them also due to lack of includes, 
  236. # regardless of whether or not configuring in main sourcedir.
  237. # @ftable removed due to bug in texi2roff-2; if your texi2roff
  238. # is newer, try just ln or cp
  239. rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
  240.         sed -e 's/^@ftable/@table/g' \
  241.         -e 's/^@end ftable/@end table/g' \
  242.         ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
  243.  
  244. inc-hist.texi: ${READLINE_DIR}/inc-hist.texi
  245.     ln -s ${READLINE_DIR}/inc-hist.texi . || \
  246.     ln ${READLINE_DIR}/inc-hist.texi . || \
  247.     cp ${READLINE_DIR}/inc-hist.texi .
  248.  
  249. # gdb manual suitable for [gtn]roff -me
  250. gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
  251.     sed -e '/\\input texinfo/d' \
  252.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  253.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  254.         -e '/^@c /d' \
  255.         -e 's/{.*,,/{/' \
  256.         -e 's/@ / /g' \
  257.         -e 's/^@alphaenumerate/@enumerate/g' \
  258.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  259.         $(srcdir)/gdb.texinfo | \
  260.     $(TEXI2ROFF) -me | \
  261.     sed -e 's/---/\\(em/g' \
  262.     >gdb.me 
  263.  
  264. # gdb manual suitable for [gtn]roff -ms
  265. gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
  266.     sed -e '/\\input texinfo/d' \
  267.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  268.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  269.         -e '/^@c /d' \
  270.         -e 's/{.*,,/{/' \
  271.         -e 's/@ / /g' \
  272.         -e 's/^@alphaenumerate/@enumerate/g' \
  273.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  274.         $(srcdir)/gdb.texinfo | \
  275.     $(TEXI2ROFF) -ms | \
  276.     sed -e 's/---/\\(em/g' \
  277.     >gdb.ms 
  278.  
  279. # gdb manual suitable for [tn]roff -mm
  280. # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, 
  281. #   try leaving them in
  282. gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
  283.     sed -e '/\\input texinfo/d' \
  284.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  285.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  286.         -e '/^@c /d' \
  287.         -e 's/{.*,,/{/' \
  288.         -e '/@noindent/d' \
  289.         -e 's/@ / /g' \
  290.         -e 's/^@alphaenumerate/@enumerate/g' \
  291.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  292.         $(srcdir)/gdb.texinfo | \
  293.     $(TEXI2ROFF) -mm | \
  294.     sed -e 's/---/\\(em/g' \
  295.     >gdb.mm 
  296.  
  297.  
  298. # GDB INTERNALS MANUAL: TeX dvi file
  299. gdbint.dvi : gdbint.texinfo
  300.     $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
  301.     $(TEXINDEX) gdbint.??
  302.     $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
  303.     rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
  304.         gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
  305.  
  306. # GDB INTERNALS MANUAL: info file
  307. gdb-internals: gdbint.info
  308.  
  309. gdbint.info: gdbint.texinfo
  310.     $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
  311.  
  312. stabs.info: stabs.texinfo
  313.     $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
  314.  
  315. # STABS DOCUMENTATION: TeX dvi file
  316. stabs.dvi : stabs.texinfo
  317.     $(SET_TEXINPUTS) $(TEX) stabs.texinfo
  318.     $(TEXINDEX) stabs.??
  319.     $(SET_TEXINPUTS) $(TEX) stabs.texinfo
  320.     rm -f stabs.?? stabs.aux stabs.cps stabs.fns stabs.kys \
  321.         stabs.log stabs.pgs stabs.toc stabs.tps stabs.vrs
  322.  
  323. stabs.ps: stabs.dvi
  324.     dvips -o stabs.ps stabs
  325.  
  326. force:
  327.  
  328. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  329.     $(SHELL) ./config.status
  330.