2
0

Makefile 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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.8
  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. # tmpdir
  61. export TMP=/tmp
  62. #
  63. #######################################################################
  64. # End of configurable section. Do not edit after this line.
  65. #######################################################################
  66. HTML = user units ref prog
  67. PS = $(addsuffix .ps, $(HTML))
  68. DVI = $(addsuffix .dvi, $(HTML))
  69. TXT = $(addsuffix .txt, $(HTML))
  70. PDF = $(addsuffix .pdf, $(HTML))
  71. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer\
  72. strings objects heaptrc)
  73. # Check if ascii-mode requested
  74. ifeq ($(ASCIIMODE),YES)
  75. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  76. endif
  77. #####################################################################
  78. # Conversion from types
  79. #####################################################################
  80. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  81. htm txt pdf refex alldist messages
  82. .SUFFIXES: .dvi .tex .ps .txt .pdf
  83. # default show help
  84. .dvi.ps:
  85. $(DVIPS) $<
  86. .tex.dvi:
  87. $(LATEX) $*
  88. -$(MAKEINDEX) $*
  89. $(LATEX) $*
  90. -$(MAKEINDEX) $*
  91. $(LATEX) $*
  92. .dvi.txt:
  93. $(DVITXT) -o $*.txt $*.dvi
  94. .tex.pdf:
  95. $(PDFLATEX) $*pdf
  96. -$(MAKEINDEX) $*pdf
  97. $(PDFLATEX) $*pdf
  98. -$(MAKEINDEX) $*pdf
  99. $(PDFLATEX) $*pdf
  100. mv $*pdf.pdf $*.pdf
  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 crtex clean
  122. -$(MAKE) -C dosex clean
  123. -$(MAKE) -C go32ex clean
  124. -$(MAKE) -C linuxex clean
  125. -$(MAKE) -C mouseex clean
  126. -$(MAKE) -C optex clean
  127. -$(MAKE) -C printex clean
  128. -$(MAKE) -C sockex clean
  129. -$(MAKE) -C mouseex clean
  130. -$(MAKE) -C go32ex clean
  131. -$(MAKE) -C stringex clean
  132. -$(MAKE) -C refex clean
  133. -$(MAKE) -C heapex clean
  134. -$(MAKE) -C objectex clean
  135. $(TXT) : %.txt: %.dvi
  136. $(DVI) : %.dvi: %.tex
  137. $(PDF) : %.pdf: %.tex
  138. unitex.chk:
  139. $(MAKE) -C crtex tex
  140. $(MAKE) -C dosex tex
  141. $(MAKE) -C go32ex tex
  142. $(MAKE) -C linuxex tex
  143. $(MAKE) -C optex tex
  144. $(MAKE) -C mouseex tex
  145. $(MAKE) -C printex tex
  146. $(MAKE) -C stringex tex
  147. $(MAKE) -C sockex tex
  148. $(MAKE) -C mouseex tex
  149. $(MAKE) -C go32ex tex
  150. $(MAKE) -C heapex tex
  151. $(MAKE) -C objectex tex
  152. $(MAKE) -C ipcex tex
  153. touch unitex.chk
  154. refex.chk:
  155. $(MAKE) -C refex tex
  156. touch refex.chk
  157. messages:
  158. msg2inc -TE ../compiler/errore.msg messages.tex
  159. date:
  160. @echo \\date\{`date +'%B %Y'`\} >date.inc
  161. units.dvi: units.tex date.inc $(CHAPTERS)
  162. ref.dvi: ref.tex date.inc
  163. prog.dvi: prog.tex date.inc
  164. user.dvi: user.tex date.inc
  165. units.pdf: units.tex $(CHAPTERS)
  166. ref.pdf: ref.tex
  167. dvi : $(DVI)
  168. txt : dvi $(TXT)
  169. ps : dvi $(PS)
  170. pdf : $(PDF)
  171. all : dvi ps pdf txt html
  172. user: user.chk
  173. user.chk: user.tex
  174. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  175. -t "User's guide for Free Pascal" user.tex
  176. sed -f foot.sed <user/footnode.html >user/footnote.html
  177. mv user/footnote.html user/footnode.html
  178. rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  179. rm -f user/images.* user/*.log
  180. touch user.chk
  181. units: units.chk
  182. units.chk: units.tex unitex.chk
  183. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  184. -t "Unit reference for Free Pascal" units.tex
  185. sed -f foot.sed <units/footnode.html >units/footnote.html
  186. mv units/footnote.html units/footnode.html
  187. rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  188. touch units.chk
  189. ref: ref.chk
  190. ref.chk: refex.chk ref.tex
  191. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  192. -t "Free Pascal reference guide" ref.tex
  193. sed -f foot.sed <ref/footnode.html >ref/footnote.html
  194. mv ref/footnote.html ref/footnode.html
  195. rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  196. touch ref.chk
  197. prog: prog.chk
  198. prog.chk: prog.tex
  199. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  200. -t "Free Pascal programmers guide" prog.tex
  201. sed -f foot.sed <prog/footnode.html >prog/footnote.html
  202. mv prog/footnote.html prog/footnode.html
  203. rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  204. touch prog.chk
  205. html: $(HTML)
  206. #####################################################################
  207. # Installation
  208. #####################################################################
  209. install:
  210. install -d -m 755 $(DOCINSTALLDIR)
  211. cp fpctoc.html $(DOCINSTALLDIR)
  212. cp -R buttons $(DOCINSTALLDIR)
  213. cp -R $(HTML) $(DOCINSTALLDIR)
  214. www-install: psdist htmldist htm
  215. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  216. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  217. #####################################################################
  218. # Archives
  219. #####################################################################
  220. psdist: $(PS)
  221. tar -cvzf fpcdocps.tar.gz $(PS)
  222. zip docs-ps $(PS)
  223. pdfdist: pdf
  224. zip docs-pdf $(PDF)
  225. dvidist: dvi
  226. zip docs-dvi $(DVI)
  227. htmldist: html
  228. find . -name '*.html' -or -name '*.gif' -or -name '*.css' >htmllist
  229. tar -czf fpcdoc.tar.gz --files-from=htmllist
  230. rm -f htmllist
  231. htm: html
  232. makehtm `find . -name '*.html'`
  233. zip -q docs-htm `find . -name '*.htm' -or -name '*.gif' -or -name '*.css'`
  234. rm `find -name '*.htm'`
  235. htmdist: htm
  236. txtdist: txt
  237. zip docs-txt $(TXT)
  238. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  239. distclean: clean
  240. -rm -f *.tar.gz *.zip
  241. #####################################################################
  242. # Examples
  243. #####################################################################
  244. examples:
  245. $(MAKE) -C crtex
  246. $(MAKE) -C dosex
  247. $(MAKE) -C optex
  248. $(MAKE) -C printex
  249. $(MAKE) -C refex
  250. $(MAKE) -C stringex
  251. $(MAKE) -C ipcex
  252. $(MAKE) -C objectex[A
  253. dosexamples: examples
  254. $(MAKE) -C go32ex
  255. $(MAKE) -C mouseex
  256. linuxexamples: examples
  257. $(MAKE) -C linuxex
  258. $(MAKE) -C sockex
  259. $(MAKE) -C ipcex
  260. #
  261. # $Log$
  262. # Revision 1.17 1999-01-17 15:12:50 michael
  263. # Added examples 27-40
  264. #
  265. # Revision 1.16 1998/12/15 23:50:53 michael
  266. # * Some updates
  267. #
  268. # Revision 1.15 1998/11/17 23:42:02 michael
  269. # + too many changes to enumerate
  270. #
  271. # Revision 1.14 1998/10/01 12:57:22 michael
  272. # + Correction in dependencies
  273. #
  274. # Revision 1.13 1998/09/13 19:26:13 michael
  275. # + Added messages target
  276. #
  277. # Revision 1.12 1998/09/13 12:42:05 michael
  278. # Added error messages and used listings package for program examples
  279. #
  280. # Revision 1.11 1998/09/11 12:08:07 michael
  281. # Additional cleans
  282. #
  283. # Revision 1.10 1998/09/11 11:01:10 peter
  284. # * export a TMP=/tmp for dvips which don't like '.' in the directory
  285. #
  286. #