Makefile 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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.5
  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 = -no_reuse -up_url "../fpctoc.html"\
  36. -up_title "Free Pascal manuals" -contents_in_navigation\
  37. -html_version 3.0
  38. endif
  39. # Ascii mode ? (i.e. no pics)
  40. ifndef ASCIIMODE
  41. ASCIIMODE=NO
  42. #ASCIIMODE=YES
  43. endif
  44. # DVI to PS converter
  45. ifndef DVIPS
  46. DVIPS=dvips
  47. endif
  48. # DVI to TXT converter
  49. ifndef DVITXT
  50. DVITXT=dvi2tty -w132
  51. endif
  52. # PDF converter
  53. ifndef PDFLATEX
  54. PDFLATEX=pdflatex
  55. endif
  56. # Makeindex programma
  57. ifndef MAKEINDEX
  58. MAKEINDEX=makeindex
  59. endif
  60. #
  61. #######################################################################
  62. # End of configurable section. Do not edit after this line.
  63. #######################################################################
  64. HTML = user units ref prog
  65. PS = $(addsuffix .ps, $(HTML))
  66. DVI = $(addsuffix .dvi, $(HTML))
  67. TXT = $(addsuffix .txt, $(HTML))
  68. PDF = $(addsuffix .pdf, $(HTML))
  69. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer strings)
  70. # Check if ascii-mode requested
  71. ifeq ($(ASCIIMODE),YES)
  72. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  73. endif
  74. #####################################################################
  75. # Conversion from types
  76. #####################################################################
  77. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  78. htm txt pdf refex alldist
  79. .SUFFIXES: .dvi .tex .ps .txt .pdf
  80. # default show help
  81. .dvi.ps:
  82. $(DVIPS) $<
  83. .tex.dvi:
  84. $(LATEX) $*
  85. -$(MAKEINDEX) $*
  86. $(LATEX) $*
  87. -$(MAKEINDEX) $*
  88. $(LATEX) $*
  89. .dvi.txt:
  90. $(DVITXT) -o $*.txt $*.dvi
  91. .tex.pdf:
  92. $(PDFLATEX) $*pdf
  93. -$(MAKEINDEX) $*pdf
  94. $(PDFLATEX) $*pdf
  95. -$(MAKEINDEX) $*pdf
  96. $(PDFLATEX) $*pdf
  97. mv $*pdf.pdf $*.pdf
  98. $(TXT) : %.txt: %.dvi
  99. $(DVI) : %.dvi: %.tex
  100. $(PDF) : %.pdf: %.tex
  101. #####################################################################
  102. # Targets
  103. #####################################################################
  104. help:
  105. @echo 'Possible targets :'
  106. @echo ' dvi : Make documentation using latex.'
  107. @echo ' ps : Make documentation using latex and dvips.'
  108. @echo ' html : Make documentation using latex2html.'
  109. @echo ' pdf : Make documentation using pdflatex'
  110. @echo ' txt : dvi, convert to text using dvi2tty'
  111. @echo ' htm : Convert .html to .htm files, zip result'
  112. @echo ' clean : Clean up the mess.'
  113. @echo ' linuxexamples : Compile all examples for linux'
  114. @echo ' dosexamples : Compile all examples for dos'
  115. @echo ' htmldist : html, and rchive result.'
  116. @echo ' psdist : ps, and archive result.'
  117. @echo ' pdfdist : pdf, and archive result.'
  118. clean:
  119. -rm -rf $(HTML)
  120. -rm -f *.aux *.log *.dvi *.ps *.toc *.i* *.lot *.pdf *.txt *.chk
  121. -$(MAKE) -C refex clean
  122. -$(MAKE) -C linuxex clean
  123. -$(MAKE) -C crtex clean
  124. -$(MAKE) -C dosex clean
  125. -$(MAKE) -C optex clean
  126. -$(MAKE) -C printex clean
  127. -$(MAKE) -C stringex clean
  128. -$(MAKE) -C sockex clean
  129. -$(MAKE) -C mouseex clean
  130. unitex.chk:
  131. $(MAKE) -C crtex tex
  132. $(MAKE) -C linuxex tex
  133. $(MAKE) -C dosex tex
  134. $(MAKE) -C optex tex
  135. $(MAKE) -C printex tex
  136. $(MAKE) -C stringex tex
  137. $(MAKE) -C sockex tex
  138. $(MAKE) -C mouseex tex
  139. touch unitex.chk
  140. refex.chk:
  141. $(MAKE) -C refex tex
  142. touch refex.chk
  143. units.dvi: units.tex $(CHAPTERS) unitex.chk
  144. ref.dvi: ref.tex refex.chk
  145. units.pdf: units.tex $(CHAPTERS) unitex.chk
  146. ref.pdf: ref.tex refex.chk
  147. dvi : $(DVI)
  148. txt : dvi $(TXT)
  149. ps : dvi $(PS)
  150. pdf : $(PDF)
  151. all : dvi ps pdf txt html
  152. user: user.chk
  153. user.chk: user.tex
  154. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  155. -t "User's guide for Free Pascal" user.tex
  156. sed -f foot.sed <user/footnode.html >user/footnote.html
  157. mv user/footnote.html user/footnode.html
  158. rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  159. rm -f user/images.* user/*.log
  160. touch user.chk
  161. units: units.chk
  162. units.chk: units.tex unitex.chk
  163. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  164. -t "Unit reference for Free Pascal" units.tex
  165. sed -f foot.sed <units/footnode.html >units/footnote.html
  166. mv units/footnote.html units/footnode.html
  167. rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  168. touch units.chk
  169. ref: ref.chk
  170. ref.chk: refex.chk ref.tex
  171. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  172. -t "Free Pascal reference guide" ref.tex
  173. sed -f foot.sed <ref/footnode.html >ref/footnote.html
  174. mv ref/footnote.html ref/footnode.html
  175. rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  176. touch ref.chk
  177. prog: prog.chk
  178. prog.chk: prog.tex
  179. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  180. -t "Free Pascal programmers guide" prog.tex
  181. sed -f foot.sed <prog/footnode.html >prog/footnote.html
  182. mv prog/footnote.html prog/footnode.html
  183. rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  184. touch prog.chk
  185. html: $(HTML)
  186. htm: html
  187. makehtm `find . -name '*.html'`
  188. zip -q fpcdoc `find . -name '*.htm'` `find . -name '*.gif'`
  189. rm `find -name '*.htm'`
  190. htmdist: htm
  191. #####################################################################
  192. # Installation
  193. #####################################################################
  194. install:
  195. install -d -m 755 $(DOCINSTALLDIR)
  196. cp fpctoc.html $(DOCINSTALLDIR)
  197. cp -R buttons $(DOCINSTALLDIR)
  198. cp -R $(HTML) $(DOCINSTALLDIR)
  199. www-install: psdist htmldist htm
  200. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  201. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  202. #####################################################################
  203. # Archives
  204. #####################################################################
  205. psdist: $(PS)
  206. tar -cvzf fpcdocps.tar.gz $(PS)
  207. zip fpcdocps $(PS)
  208. pdfdist: pdf
  209. zip fpcdocpdf $(PDF)
  210. dvidist: dvi
  211. zip fpcdocdvi $(DVI)
  212. htmldist: html
  213. find . -name '*.html' >htmllist
  214. find . -name '*.gif' >>htmllist
  215. tar -czf fpcdoc.tar.gz --files-from=htmllist
  216. rm -f htmllist
  217. txtdist: txt
  218. zip fpcdoctxt $(TXT)
  219. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  220. distclean: clean
  221. -rm -f *.tar.gz *.zip
  222. #####################################################################
  223. # Examples
  224. #####################################################################
  225. examples:
  226. $(MAKE) -C crtex
  227. $(MAKE) -C dosex
  228. $(MAKE) -C crtex
  229. $(MAKE) -C dosex
  230. $(MAKE) -C optex
  231. $(MAKE) -C printex
  232. $(MAKE) -C refex
  233. $(MAKE) -C sockex
  234. $(MAKE) -C stringex
  235. dosexamples: examples
  236. $(MAKE) -C go32ex
  237. $(MAKE) -C mouseex
  238. linuxexamples: examples
  239. $(MAKE) -C linuxex
  240. $(MAKE) -C sockex