Makefile 9.0 KB

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