Makefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. #
  2. # $Id$
  3. # This file is part of the Free Pascal run time library.
  4. # Copyright (c) 1996-98 by Michael van Canneyt
  5. #
  6. # Makefile for the Free Pascal Documentation
  7. #
  8. # See the file COPYING.FPC, included in this distribution,
  9. # for details about the copyright.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. #####################################################################
  16. # Configurable section
  17. #####################################################################
  18. # Where do you want the html files to be put ?
  19. ifndef DOCINSTALLDIR
  20. DOCINSTALLDIR=/usr/doc/fpc-0.99.0
  21. endif
  22. #
  23. # Program definitions
  24. #
  25. # Latex
  26. ifndef LATEX
  27. LATEX = latex
  28. endif
  29. # Latex2html conversion.
  30. ifndef LATEX2HTML
  31. LATEX2HTML = latex2html
  32. endif
  33. # Options for converter
  34. ifndef LATEX2HTMLOPTS
  35. LATEX2HTMLOPTS = -ascii_mode -no_reuse -up_url "../fpctoc.html"\
  36. -up_title "Free Pascal manuals" -contents_in_navigation\
  37. -html_version 3.0
  38. endif
  39. # DVI to PS converter
  40. ifndef DVIPS
  41. DVIPS=dvips
  42. endif
  43. # DVI to TXT converter
  44. ifndef DVITXT
  45. DVITXT=dvi2tty -w132
  46. endif
  47. # PDF converter
  48. ifndef PDFLATEX
  49. PDFLATEX=pdflatex
  50. endif
  51. # Makeindex programma
  52. ifndef MAKEINDEX
  53. MAKEINDEX=makeindex
  54. endif
  55. #
  56. #######################################################################
  57. # End of configurable section. Do not edit after this line.
  58. #######################################################################
  59. HTML = user units ref prog
  60. PS = $(addsuffix .ps, $(HTML))
  61. DVI = $(addsuffix .dvi, $(HTML))
  62. TXT = $(addsuffix .txt, $(HTML))
  63. PDF = $(addsuffix .pdf, $(HTML))
  64. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer strings)
  65. #####################################################################
  66. # Conversion from types
  67. #####################################################################
  68. .PHONY: all clean dvi help html ps psdist htmldist htm txt pdf refex
  69. .SUFFIXES: .dvi .tex .ps .txt .pdf
  70. # default show help
  71. all: help
  72. .dvi.ps:
  73. $(DVIPS) $<
  74. .tex.dvi:
  75. $(LATEX) $*
  76. -$(MAKEINDEX) $*
  77. $(LATEX) $*
  78. -$(MAKEINDEX) $*
  79. $(LATEX) $*
  80. .dvi.txt:
  81. $(DVITXT) -o $*.txt $*.dvi
  82. .tex.pdf:
  83. $(PDFLATEX) $*pdf
  84. -$(MAKEINDEX) $*pdf
  85. $(PDFLATEX) $*pdf
  86. -$(MAKEINDEX) $*pdf
  87. $(PDFLATEX) $*pdf
  88. $(TXT) : %.txt: %.dvi
  89. $(DVI) : %.dvi: %.tex
  90. $(PDF) : %.pdf: %.tex
  91. #####################################################################
  92. # Targets
  93. #####################################################################
  94. help:
  95. @echo 'Possible targets :'
  96. @echo ' dvi : Make documentation using latex.'
  97. @echo ' ps : Make documentation using latex and dvips.'
  98. @echo ' html : Make documentation using latex2html.'
  99. @echo ' htm : Convert .html to .htm files, zip result'
  100. @echo ' clean : Clean up the mess.'
  101. clean:
  102. -rm -rf $(HTML)
  103. -rm -f *.aux *.log *.dvi *.ps *.toc *.i* *.lot *.pdf *.txt
  104. -$(MAKE) -C refex clean
  105. -$(MAKE) -C linuxex clean
  106. -$(MAKE) -C crtex clean
  107. -$(MAKE) -C dosex clean
  108. -$(MAKE) -C optex clean
  109. -$(MAKE) -C printex clean
  110. -$(MAKE) -C stringex clean
  111. -$(MAKE) -C sockex clean
  112. unitex:
  113. $(MAKE) -C crtex tex
  114. $(MAKE) -C linuxex tex
  115. $(MAKE) -C dosex tex
  116. $(MAKE) -C optex tex
  117. $(MAKE) -C printex tex
  118. $(MAKE) -C stringex tex
  119. $(MAKE) -C sockex tex
  120. refex:
  121. $(MAKE) -C refex tex
  122. units.dvi: units.tex $(CHAPTERS) unitex
  123. ref.dvi: ref.tex refex
  124. dvi : $(DVI)
  125. txt : dvi $(TXT)
  126. ps : dvi $(PS)
  127. pdf : $(PDF)
  128. user:
  129. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  130. -t "User's guide for Free Pascal" user.tex
  131. sed -f foot.sed <user/footnode.html >user/footnote.html
  132. mv user/footnote.html user/footnode.html
  133. rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  134. rm -f user/images.* user/*.log
  135. units: unitex
  136. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  137. -t "Unit reference for Free Pascal" units.tex
  138. sed -f foot.sed <units/footnode.html >units/footnote.html
  139. mv units/footnote.html units/footnode.html
  140. rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  141. ref: refex
  142. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  143. -t "Free Pascal reference guide" ref.tex
  144. sed -f foot.sed <ref/footnode.html >ref/footnote.html
  145. mv ref/footnote.html ref/footnode.html
  146. rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  147. prog:
  148. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  149. -t "Free Pascal programmers guide" prog.tex
  150. sed -f foot.sed <prog/footnode.html >prog/footnote.html
  151. mv prog/footnote.html prog/footnode.html
  152. rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  153. html: $(HTML)
  154. htm:
  155. makehtm `find . -name '*.html'`
  156. zip fpcdoc `find . -name '*.htm'`
  157. rm `find -name '*.htm'`
  158. all-formats: ps txt pdf html
  159. #####################################################################
  160. # Installation
  161. #####################################################################
  162. install:
  163. install -d -m 755 $(DOCINSTALLDIR)
  164. cp -R $(HTML) $(DOCINSTALLDIR)
  165. cp fpctoc.html $(DOCINSTALLDIR)
  166. www-install: psdist htmldist htm
  167. rcp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  168. rsh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  169. #####################################################################
  170. # Distribution
  171. #####################################################################
  172. psdist: ps
  173. tar -cvzf fpcdocps.tar.gz *.ps
  174. zip fpcdocps *.ps
  175. pdfdist: pdf
  176. zip fpcdocpdf *.pdf
  177. htmldist: html
  178. find . -name '*.html' >htmllist
  179. find . -name '*.gif' >>htmllist
  180. tar -czvf fpcdoc.tar.gz --files-from=htmllist
  181. rm -f htmllist
  182. dist:
  183. -mkdir $(DISTDIR)/docs
  184. cp Makefile README.DOCS makehtm fpktoc.html $(DISTDIR)/docs
  185. cp *.tex *.sty *.perl *.doc $(DISTDIR)/docs
  186. distclean: clean
  187. -rm -f *.tar.gz *.zip