Makefile 8.6 KB

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