home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Doc / Makefile < prev    next >
Encoding:
Makefile  |  1995-12-17  |  6.9 KB  |  235 lines  |  [TEXT/R*ch]

  1. # Makefile for Python documentation
  2. # ---------------------------------
  3. #
  4. # See also the README file.
  5. #
  6. # This is a bit of a mess.  The main documents are:
  7. #   tut -- Tutorial (file tut.tex)
  8. #   lib -- Library Reference (file lib.tex, inputs lib*.tex)
  9. #   ref -- Language Reference (file ref.tex, inputs ref*.tex)
  10. #   ext -- Extending and Embedding (file ext.tex)
  11. #
  12. # The main target "make all" creates DVI and PostScript for these
  13. # four.  You can also do "make lib" (etc.) to process individual
  14. # documents.
  15. #
  16. # There's also:
  17. #   qua -- Paper published in the CWI Quarterly (file qua.tex)
  18. #
  19. # There's one local style file: myformat.sty.  This defines a number
  20. # of macros that are similar in name and intent as macros in Texinfo
  21. # (e.g. \code{...} and \emph{...}), as well as a number of
  22. # environments for formatting function and data definitions, also in
  23. # the style of Texinfo.
  24. #
  25. # Everything is processed by LaTeX.  The following tools are used:
  26. #   latex
  27. #   makeindex
  28. #   dvips
  29. #   bibtex (only for formatting qua.tex)
  30. #
  31. # There's a problem with generating the index which has been solved by
  32. # a sed command applied to the index file.  The shell script fix_hack
  33. # does this (the Makefile takes care of calling it).
  34. #
  35. # To preview the dvi files produced by LaTeX it would be useful to
  36. # have xdvi as well.
  37. #
  38. # Additional targets attempt to convert selected LaTeX sources to
  39. # various other formats.  These are generally site specific because
  40. # the tools used are all but universal.  These targets are:
  41. #   l2h -- convert tut, ref, ext (but not lib!) from LaTeX to HTML
  42. #   lib.texi -- convert lib from LaTeX to Texinfo
  43. #   lib.info -- convert lib from Texinfo to Emacs INFO
  44. #   libwww -- convert lib from Texinfo to HTML
  45. # See the README file for more info on these targets.
  46.  
  47. # Customizations -- you *may* have to edit these
  48.  
  49. # Where are the various programs?
  50. LATEX=        latex
  51. BIBTEX=        bibtex
  52. EMACS=        emacs
  53. DVIPS=        dvips -f
  54. MAKEINDEX=    makeindex
  55. PYTHON=        python
  56. MAKEINFO=    makeinfo
  57. L2H=        /ufs/guido/l2h/latex2html
  58. L2HARGS=    -address $$USER@`domainname` -dont_include myformat
  59.  
  60. # Install destination -- not used now but might be useful some time...
  61. DESTDIR=    /usr/local
  62. LIBDESTDIR=    $DESTDIR/lib
  63. LIBDEST=    $LIBDESTDIR/python
  64. DOCDESTDIR=    $LIBDEST/doc
  65.  
  66. # Ideally, you shouldn't need to edit beyond this point
  67.  
  68. # Main target
  69. all:    tut.dvi lib.dvi ref.dvi ext.dvi
  70.  
  71. # Individual document fake targets
  72. tut:    tut.dvi
  73. lib:    lib.dvi
  74. ref:    ref.dvi
  75. ext:    ext.dvi
  76.  
  77. # CWI Quarterly document fake target
  78. qua:    qua.dvi
  79.  
  80. # Dependencies
  81. tut.dvi lib.dvi ref.dvi ext.dvi: myformat.sty fix_hack
  82.  
  83. # Tutorial document
  84. tut.dvi: tut.tex 
  85.     $(LATEX) tut
  86.     $(LATEX) tut
  87.     $(DVIPS) tut >tut.ps
  88.  
  89. # Reference document
  90. ref.dvi: ref.tex ref1.tex ref2.tex ref3.tex ref4.tex ref5.tex ref6.tex \
  91.                              ref7.tex ref8.tex 
  92.     touch ref.ind
  93.     $(LATEX) ref
  94.     ./fix_hack ref.idx
  95.     $(MAKEINDEX) ref
  96.     $(LATEX) ref
  97.     $(DVIPS) ref >ref.ps
  98.  
  99. # LaTeX source files for the Python Library Reference
  100. LIBFILES = lib.tex \
  101. libal.tex libaifc.tex liballos.tex \
  102.     libamoeba.tex libarray.tex libaudio.tex libaudioop.tex \
  103. libbltin.tex libbinascii.tex \
  104. libcd.tex \
  105. libcgi.tex libcopy.tex libctb.tex libcrypto.tex \
  106. libdbm.tex \
  107. libexcs.tex \
  108. libfcntl.tex libfl.tex libfm.tex libftplib.tex libfuncs.tex \
  109. libgdbm.tex libgetopt.tex libgl.tex libgopherlib.tex libgrp.tex \
  110. libhtmllib.tex libhttplib.tex \
  111. libimageop.tex libimgfile.tex libintro.tex \
  112. libjpeg.tex \
  113. libmac.tex libmacconsole.tex libmacdnr.tex \
  114.     libmacfs.tex libmacos.tex libmacostools.tex libmactcp.tex \
  115.     libmacspeech.tex libmacui.tex \
  116.     libmain.tex libmarshal.tex libmath.tex \
  117.     libmd5.tex libmimetools.tex libmisc.tex \
  118.     libmm.tex libmpz.tex \
  119. libnntplib.tex \
  120. libobjs.tex libos.tex \
  121. libpanel.tex libparser.tex libpickle.tex libposix.tex libposixfile.tex \
  122.     libppath.tex libprofile.tex libpwd.tex libpython.tex \
  123. librand.tex libregex.tex libregsub.tex \
  124.     librfc822.tex librgbimg.tex librotor.tex \
  125. libselect.tex libsgi.tex libsgmllib.tex \
  126.     libshelve.tex libsocket.tex libsomeos.tex libstdwin.tex \
  127.     libstring.tex libstrings.tex libstruct.tex libsun.tex libsys.tex \
  128. libtempfile.tex libtermios.tex libthread.tex libtime.tex \
  129.     libtraceback.tex libtypes.tex libtypes2.tex \
  130. libunix.tex liburllib.tex liburlparse.tex \
  131. libwhrandom.tex libwww.tex
  132.  
  133. # Library document
  134. lib.dvi: $(LIBFILES)
  135.     touch lib.ind
  136.     $(LATEX) lib
  137.     ./fix_hack lib.idx
  138.     $(MAKEINDEX) lib
  139.     $(LATEX) lib
  140.     $(DVIPS) lib >lib.ps
  141.  
  142. # Extensions document
  143. ext.dvi: ext.tex 
  144.     touch ext.ind
  145.     $(LATEX) ext
  146.     ./fix_hack ext.idx
  147.     $(MAKEINDEX) ext
  148.     $(LATEX) ext
  149.     $(DVIPS) ext >ext.ps
  150.  
  151. # Quarterly document
  152. qua.dvi: qua.tex quabib.bib
  153.     $(LATEX) qua
  154.     $(BIBTEX) qua
  155.     $(LATEX) qua
  156.     $(BIBTEX) qua
  157.     $(DVIPS) qua >qua.ps
  158.  
  159.  
  160. # The remaining part of the Makefile is concerned with various
  161. # conversions, as described above.  See also the README file.
  162.  
  163. lib.texi: lib*.tex texipre.dat texipost.dat partparse.py fix.el
  164.     $(PYTHON) partparse.py -o @lib.texi `./whichlibs`
  165.     $(EMACS) -batch -l fix.el -f save-buffer -kill
  166.     mv @lib.texi lib.texi
  167.  
  168. .PRECIOUS:    lib.texi
  169.  
  170. python-lib.info: lib.texi
  171.     -$(MAKEINFO) --footnote-style end --fill-column 72 \
  172.              --paragraph-indent 0 lib.texi
  173.  
  174. lib.info: python-lib.info
  175.  
  176. # This target is very local to CWI...
  177. libwww: lib.texi
  178.     $(PYTHON) texi2html.py -d lib.texi /ufs/guido/public_html/python-lib
  179.  
  180. # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
  181. # HTML converter.  For more info on this program, see
  182. # <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
  183. # (I've had some trouble getting this to work with the netpbm version
  184. # of the pbmplus library; ppmtogif dumped core because giftopnm
  185. # outputs bitmap (pbm) files.  I've fixed this by changing the source
  186. # of LaTeX2HTML to insert a call to pnmtoppm, which I wrote myself.
  187. # You can probably also use "pbmtopgm | pgmtoppm"...
  188.  
  189. # In order to use these targets, you must edit the definition of L2H
  190. # earlier in the Makefile to point to the latex2html program.  Note
  191. # that LaTeX2HTML inserts references to an "icons" directory in each
  192. # page that it generates.  You can customize where these icons are to
  193. # be found; I generally make it point to "../icons" and then create a
  194. # symbolic link to the icons directory in the LaTeX2HTML source at the
  195. # appropriate place.
  196.  
  197. l2h: l2htut l2href l2hext
  198.  
  199. l2htut: tut
  200.     $(L2H) $(L2HARGS) tut.tex
  201.     @rm -rf python-tut
  202.     mv tut python-tut
  203.  
  204. l2href: ref
  205.     $(L2H) $(L2HARGS) ref.tex
  206.     @rm -rf python-ref
  207.     mv ref python-ref
  208.  
  209. l2hext: ext
  210.     $(L2H) $(L2HARGS) ext.tex
  211.     @rm -rf python-ext
  212.     mv ext python-ext
  213.  
  214. # This target doesn't quite work, since l2h doesn't understand the
  215. # funcdesc and similar environments, and turns them into GIF images.
  216. # Use the "libwww" target above instead.
  217. l2hlib: lib
  218.     $(L2H) $(L2HARGS) lib.tex
  219.     @rm -rf python-lib
  220.     mv lib python-lib
  221.  
  222.  
  223. # Housekeeping targets
  224.  
  225. # Remove temporary files
  226. clean:
  227.     rm -f @* *~ *.aux *.idx *.ilg *.ind *.log *.toc *.blg *.bbl *.pyc
  228.     rm -f *.bak *.orig
  229.     # Sources: .tex, .bib, .sty
  230.     # Useful results: .dvi, .ps, .texi, .info
  231.  
  232. # Remove temporaries as well as final products
  233. clobber: clean
  234.      rm -f *.dvi *.ps *.texi *.info *.info-[0-9]*
  235.