home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / doc / Makefile.in < prev    next >
Encoding:
Makefile  |  1993-05-12  |  9.7 KB  |  311 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. DOC_CONFIG = all
  49.  
  50. # Don Knuth's TeX formatter
  51. TEX = tex
  52.  
  53. # auxiliary program for sorting Texinfo indices
  54. TEXINDEX = texindex
  55.  
  56. # Main GDB manual's source files
  57. SFILES_INCLUDED = gdb-config.texi $(srcdir)/gdbinv-s.texi
  58.  
  59. SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
  60.  
  61. SFILES_DOC = $(SFILES_LOCAL) \
  62.                 $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi
  63.  
  64. #### Host, target, and site specific Makefile fragments come in here.
  65. ###
  66.  
  67. all install:
  68.  
  69. info: gdb.info gdbint.info stabs.info
  70. dvi: gdb.dvi refcard.dvi gdbint.dvi
  71. all-doc: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi
  72.  
  73. install-info: info
  74.     -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
  75.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  76.     -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
  77.     for i in *.info* ; do \
  78.         $(INSTALL_DATA) $$i $(infodir)/$$i ; \
  79.     done
  80.  
  81. STAGESTUFF = *.info* gdb-all.texi GDBvn.texi
  82.  
  83. # Copy the object files from a particular stage into a subdirectory.
  84. stage1: force
  85.     -mkdir stage1
  86.     -mv $(STAGESTUFF) stage1
  87.  
  88. stage2: force
  89.     -mkdir stage2
  90.     -mv $(STAGESTUFF) stage2
  91.  
  92. stage3: force
  93.     -mkdir stage3
  94.     -mv $(STAGESTUFF) stage3
  95.  
  96. against=stage2
  97.  
  98. comparison: force
  99.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  100.  
  101. de-stage1: force
  102.     -(cd stage1 ; mv -f * ..)
  103.     -rmdir stage1
  104.  
  105. de-stage2: force
  106.     -(cd stage2 ; mv -f * ..)
  107.     -rmdir stage2
  108.  
  109. de-stage3: force
  110.     -(cd stage3 ; mv -f * ..)
  111.     -rmdir stage3
  112.  
  113. clean-info:
  114.     rm -f gdb.info* gdbint.info* stabs.info*
  115.  
  116. clean-dvi:
  117.     rm -f gdb.dvi refcard.dvi gdbint.dvi stabs.dvi psref.dvi
  118.     
  119. mostlyclean: clean-info clean-dvi
  120.     rm -f gdb.?? gdb.??? gdb.mm gdb.ms gdb.me
  121.     rm -f links2roff
  122.     rm -f refcard.ps lrefcard.ps refcard.log psref.* *~
  123.     rm -f gdbint.?? gdbint.??? stabs.?? stabs.???
  124.  
  125. clean: mostlyclean
  126.     rm -f GDBvn.texi rluser.texinfo inc-hist.texi
  127.  
  128. distclean: clean
  129.     rm -f Makefile config.status
  130.  
  131. realclean: distclean
  132.  
  133.  
  134. # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
  135. refcard.dvi : $(srcdir)/refcard.tex
  136.     $(SET_TEXINPUTS) $(TEX) refcard.tex; rm -f refcard.log 
  137.     rm -f rcfonts.tex
  138.  
  139. # GDB QUICK REFERENCE (PostScript output, common PS fonts)
  140. refcard.ps : $(srcdir)/refcard.tex $(srcdir)/psrc.sed
  141.     sed -f $(srcdir)/psrc.sed $(srcdir)/refcard.tex >psref.tex
  142.     $(SET_TEXINPUTS) $(TEX) psref.tex
  143.     dvips -t landscape psref -o; mv psref.ps refcard.ps
  144.     rm -f psref.dvi psref.log psref.tex
  145.  
  146. # GDB QUICK REFERENCE (PostScript output, common PS fonts w/long names)
  147. lrefcard.ps : $(srcdir)/refcard.tex $(srcdir)/lpsrc.sed
  148.     sed -f $(srcdir)/lpsrc.sed $(srcdir)/refcard.tex >psref.tex
  149.     $(SET_TEXINPUTS) $(TEX) psref.tex
  150.     dvips -t landscape psref -o; mv psref.ps lrefcard.ps
  151.     rm -f psref.dvi psref.log psref.tex
  152.  
  153. # File to record current GDB version number (copied from main dir Makefile.in)
  154. GDBvn.texi : ${gdbdir}/Makefile.in
  155.     echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`" > ./GDBvn.texi
  156.  
  157. # Choose configuration for GDB manual (normally `all'; normally not tied into
  158. # `configure' script because most users prefer generic version of manual,
  159. # not one for their binary config---which may not be specifically
  160. # defined anyways).
  161. gdb-config.texi: ${srcdir}/${DOC_CONFIG}-config.texi
  162.     ln -s ${srcdir}/${DOC_CONFIG}-config.texi gdb-config.texi || \
  163.     ln ${srcdir}/${DOC_CONFIG}-config.texi gdb-config.texi || \
  164.     cp ${srcdir}/${DOC_CONFIG}-config.texi gdb-config.texi
  165.  
  166. # GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear
  167. # If your texinfo or makeinfo don't support these, get a new texinfo release
  168. #
  169. # The nonsense with GDBvn.texi gets this to run with both Sun and GNU make.
  170. #   Note that we can *generate* GDBvn.texi, but since we distribute one in the
  171. #   source directory for the benefit of people who *don't* use this makefile,
  172. #   VPATH will often tell make not to bother building it, because the one
  173. #   in the srcdir is up to date.  (if not, then make should build one here).
  174.  
  175. # GDB MANUAL: TeX dvi file
  176. gdb.dvi: ${SFILES_DOC}
  177.     if [ ! -f ./GDBvn.texi ]; then \
  178.         ln -s $(srcdir)/GDBvn.texi . || \
  179.         ln $(srcdir)/GDBvn.texi . || \
  180.         cp $(srcdir)/GDBvn.texi . ; else true; fi
  181.     $(SET_TEXINPUTS) $(TEX) gdb.texinfo
  182.     $(SET_TEXINPUTS) $(TEX) gdb.texinfo
  183.     $(TEXINDEX) gdb.??
  184.     $(SET_TEXINPUTS) $(TEX) gdb.texinfo
  185.     rm -f gdb.?? gdb.log gdb.aux gdb.toc gdb.??s
  186.  
  187. # GDB MANUAL: info file
  188. # We're using texinfo2, and older makeinfo's may not be able to
  189. # cope with all the markup.  
  190. gdb.info: ${SFILES_DOC}
  191.     $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
  192.  
  193. # GDB MANUAL: roff translations
  194. # Try to use a recent texi2roff.  v2 was put on prep in jan91.
  195. # If you want an index, see texi2roff doc for postprocessing 
  196. # and add -i to texi2roff invocations below.
  197. # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
  198. #    corresponding -e lines when later texi2roff's are current)
  199. # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
  200. # + @c's deleted explicitly because texi2roff sees texinfo commands in them
  201. # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
  202. # + @alphaenumerate is ridiculously new, turned into @enumerate
  203.  
  204. # texi2roff doesn't have a notion of include dirs, so we have to fake 
  205. # it out for gdb manual's include files---but only if not configured
  206. # in main sourcedir.
  207. links2roff: $(SFILES_INCLUDED)
  208.     if [ ! -f gdb.texinfo ]; then \
  209.         ln -s $(SFILES_INCLUDED) . || \
  210.         ln $(SFILES_INCLUDED)    . || \
  211.         cp $(SFILES_INCLUDED)    . ; \
  212.     fi
  213.     touch links2roff
  214.  
  215. #  "Readline" appendices.  Get them also due to lack of includes, 
  216. # regardless of whether or not configuring in main sourcedir.
  217. # @ftable removed due to bug in texi2roff-2; if your texi2roff
  218. # is newer, try just ln or cp
  219. rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
  220.         sed -e 's/^@ftable/@table/g' \
  221.         -e 's/^@end ftable/@end table/g' \
  222.         ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
  223.  
  224. inc-hist.texi: ${READLINE_DIR}/inc-hist.texi
  225.     ln -s ${READLINE_DIR}/inc-hist.texi . || \
  226.     ln ${READLINE_DIR}/inc-hist.texi . || \
  227.     cp ${READLINE_DIR}/inc-hist.texi .
  228.  
  229. # gdb manual suitable for [gtn]roff -me
  230. gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
  231.     sed -e '/\\input texinfo/d' \
  232.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  233.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  234.         -e '/^@c /d' \
  235.         -e 's/{.*,,/{/' \
  236.         -e 's/@ / /g' \
  237.         -e 's/^@alphaenumerate/@enumerate/g' \
  238.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  239.         $(srcdir)/gdb.texinfo | \
  240.     $(TEXI2ROFF) -me | \
  241.     sed -e 's/---/\\(em/g' \
  242.     >gdb.me 
  243.  
  244. # gdb manual suitable for [gtn]roff -ms
  245. gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
  246.     sed -e '/\\input texinfo/d' \
  247.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  248.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  249.         -e '/^@c /d' \
  250.         -e 's/{.*,,/{/' \
  251.         -e 's/@ / /g' \
  252.         -e 's/^@alphaenumerate/@enumerate/g' \
  253.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  254.         $(srcdir)/gdb.texinfo | \
  255.     $(TEXI2ROFF) -ms | \
  256.     sed -e 's/---/\\(em/g' \
  257.     >gdb.ms 
  258.  
  259. # gdb manual suitable for [tn]roff -mm
  260. # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, 
  261. #   try leaving them in
  262. gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
  263.     sed -e '/\\input texinfo/d' \
  264.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  265.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  266.         -e '/^@c /d' \
  267.         -e 's/{.*,,/{/' \
  268.         -e '/@noindent/d' \
  269.         -e 's/@ / /g' \
  270.         -e 's/^@alphaenumerate/@enumerate/g' \
  271.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  272.         $(srcdir)/gdb.texinfo | \
  273.     $(TEXI2ROFF) -mm | \
  274.     sed -e 's/---/\\(em/g' \
  275.     >gdb.mm 
  276.  
  277. # GDB INTERNALS MANUAL: TeX dvi file
  278. gdbint.dvi : gdbint.texinfo
  279.     $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
  280.     $(TEXINDEX) gdbint.??
  281.     $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
  282.     rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
  283.         gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
  284.  
  285. # GDB INTERNALS MANUAL: info file
  286. gdb-internals: gdbint.info
  287.  
  288. gdbint.info: gdbint.texinfo
  289.     $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
  290.  
  291. stabs.info: stabs.texinfo
  292.     $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
  293.  
  294. # STABS DOCUMENTATION: TeX dvi file
  295. stabs.dvi : stabs.texinfo
  296.     $(SET_TEXINPUTS) $(TEX) stabs.texinfo
  297.     $(TEXINDEX) stabs.??
  298.     $(SET_TEXINPUTS) $(TEX) stabs.texinfo
  299.     rm -f stabs.?? stabs.aux stabs.cps stabs.fns stabs.kys \
  300.         stabs.log stabs.pgs stabs.toc stabs.tps stabs.vrs
  301.  
  302. stabs.ps: stabs.dvi
  303.     dvips -o stabs.ps stabs
  304.  
  305. force:
  306.  
  307. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  308.     $(SHELL) ./config.status
  309.