Makefile 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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. # Which docs are made when 'html' is specified
  19. HTML = user units ref prog
  20. # Where do you want the html files to be put ?
  21. ifndef DOCINSTALLDIR
  22. DOCINSTALLDIR=/usr/doc/fpc-0.99.12
  23. endif
  24. #
  25. # Program definitions
  26. #
  27. # Latex
  28. ifndef LATEX
  29. LATEX = latex
  30. endif
  31. # Latex2html conversion.
  32. ifndef LATEX2HTML
  33. LATEX2HTML = latex2html
  34. endif
  35. # Options for converter
  36. ifndef LATEX2HTMLOPTS
  37. LATEX2HTMLOPTS = -no_reuse -up_url "../fpctoc.html"\
  38. -up_title "Free Pascal manuals" -contents_in_navigation\
  39. -html_version 3.2
  40. endif
  41. # Ascii mode ? (i.e. no pics)
  42. ifndef ASCIIMODE
  43. ASCIIMODE=NO
  44. #ASCIIMODE=YES
  45. endif
  46. # DVI to PS converter
  47. ifndef DVIPS
  48. DVIPS=dvips
  49. endif
  50. # DVI to TXT converter
  51. ifndef DVITXT
  52. DVITXT=dvi2tty -w132
  53. endif
  54. # PDF converter
  55. ifndef PDFLATEX
  56. PDFLATEX=pdflatex
  57. endif
  58. # Makeindex programma
  59. ifndef MAKEINDEX
  60. MAKEINDEX=makeindex
  61. endif
  62. # tmpdir
  63. export TMP=/tmp
  64. #
  65. #######################################################################
  66. # End of configurable section. Do not edit after this line.
  67. #######################################################################
  68. PS = $(addsuffix .ps, $(HTML))
  69. DVI = $(addsuffix .dvi, $(HTML))
  70. TXT = $(addsuffix .txt, $(HTML))
  71. PDF = $(addsuffix .pdf, $(HTML))
  72. TOC = $(addsuffix .toc, $(HTML))
  73. AUX = $(addsuffix .aux, $(HTML))
  74. LOG = $(addsuffix .log, $(HTML))
  75. LOT = $(addsuffix .lot, $(HTML))
  76. OUT = $(addsuffix .out, $(HTML))
  77. CHK = $(addsuffix .chk, $(HTML) unitex refex)
  78. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer\
  79. strings objects heaptrc sysutils ipc mouse)
  80. # Check if ascii-mode requested
  81. ifeq ($(ASCIIMODE),YES)
  82. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  83. endif
  84. #####################################################################
  85. # Conversion from types
  86. #####################################################################
  87. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  88. htm txt pdf refex alldist messages
  89. .SUFFIXES: .dvi .tex .ps .txt .pdf
  90. # default show help
  91. .dvi.ps:
  92. $(DVIPS) $<
  93. .tex.dvi:
  94. $(LATEX) $*
  95. -$(MAKEINDEX) $*
  96. $(LATEX) $*
  97. -$(MAKEINDEX) $*
  98. $(LATEX) $*
  99. .dvi.txt:
  100. $(DVITXT) -o $*.txt $*.dvi
  101. .tex.pdf:
  102. $(PDFLATEX) $*
  103. -$(MAKEINDEX) $*
  104. $(PDFLATEX) $*
  105. -$(MAKEINDEX) $*
  106. $(PDFLATEX) $*
  107. #####################################################################
  108. # Targets
  109. #####################################################################
  110. help:
  111. @echo 'Possible targets :'
  112. @echo ' dvi : Make documentation using latex.'
  113. @echo ' ps : Make documentation using latex and dvips.'
  114. @echo ' html : Make documentation using latex2html.'
  115. @echo ' pdf : Make documentation using pdflatex'
  116. @echo ' txt : dvi, convert to text using dvi2tty'
  117. @echo ' htm : Convert .html to .htm files, zip result'
  118. @echo ' clean : Clean up the mess.'
  119. @echo ' linuxexamples : Compile all examples for linux'
  120. @echo ' dosexamples : Compile all examples for dos'
  121. @echo ' htmldist : html, and rchive result.'
  122. @echo ' psdist : ps, and archive result.'
  123. @echo ' pdfdist : pdf, and archive result.'
  124. clean:
  125. -rm -rf $(HTML)
  126. -rm -f $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) *.i* $(LOT) $(TXT) $(CHK)
  127. # Units
  128. -$(MAKE) -C crtex clean
  129. -$(MAKE) -C dosex clean
  130. -$(MAKE) -C go32ex clean
  131. -$(MAKE) -C heapex clean
  132. -$(MAKE) -C ipcex clean
  133. -$(MAKE) -C linuxex clean
  134. -$(MAKE) -C mouseex clean
  135. -$(MAKE) -C objectex clean
  136. -$(MAKE) -C opclean clean
  137. -$(MAKE) -C printex clean
  138. -$(MAKE) -C sockex clean
  139. -$(MAKE) -C stringex clean
  140. -$(MAKE) -C sysutex clean
  141. # Reference
  142. -$(MAKE) -C refex clean
  143. $(TXT) : %.txt: %.dvi
  144. $(DVI) : %.dvi: %.tex
  145. $(PDF) : %.pdf: %.tex
  146. unitex.chk:
  147. $(MAKE) -C crtex tex
  148. $(MAKE) -C dosex tex
  149. $(MAKE) -C go32ex tex
  150. $(MAKE) -C heapex tex
  151. $(MAKE) -C ipcex tex
  152. $(MAKE) -C linuxex tex
  153. $(MAKE) -C mouseex tex
  154. $(MAKE) -C objectex tex
  155. $(MAKE) -C optex tex
  156. $(MAKE) -C printex tex
  157. $(MAKE) -C sockex tex
  158. $(MAKE) -C stringex tex
  159. $(MAKE) -C sysutex tex
  160. touch unitex.chk
  161. refex.chk:
  162. $(MAKE) -C refex tex
  163. touch refex.chk
  164. messages:
  165. msg2inc -TE ../compiler/errore.msg messages.tex
  166. date.inc:
  167. @echo \\date\{`date +'%B %Y'`\} > date.inc
  168. units.dvi: units.tex date.inc $(CHAPTERS)
  169. ref.dvi: ref.tex date.inc
  170. prog.dvi: prog.tex date.inc
  171. user.dvi: user.tex date.inc
  172. units.pdf: units.tex date.inc $(CHAPTERS)
  173. ref.pdf: ref.tex date.inc
  174. user.pdf: user.tex date.inc
  175. prog.pdf: prog.tex date.inc
  176. dvi : $(DVI)
  177. txt : dvi $(TXT)
  178. ps : dvi $(PS)
  179. pdf : $(PDF)
  180. all : dvi ps pdf txt html
  181. #####################################################################
  182. # Html creation
  183. #####################################################################
  184. user: user.chk
  185. user.chk: user.tex date.inc
  186. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  187. -t "User's guide for Free Pascal" user.tex
  188. -sed -f foot.sed <user/footnode.html >user/footnote.html
  189. -mv user/footnote.html user/footnode.html
  190. -rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  191. -rm -f user/images.* user/*.log user/WARNINGS
  192. touch user.chk
  193. units: units.chk
  194. units.chk: units.tex unitex.chk date.inc
  195. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  196. -t "Unit reference for Free Pascal" units.tex
  197. -sed -f foot.sed <units/footnode.html >units/footnote.html
  198. -mv units/footnote.html units/footnode.html
  199. -rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  200. -rm -f units/images.* units/*.log units/WARNINGS
  201. touch units.chk
  202. ref: ref.chk
  203. ref.chk: refex.chk ref.tex date.inc
  204. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  205. -t "Free Pascal reference guide" ref.tex
  206. -sed -f foot.sed <ref/footnode.html >ref/footnote.html
  207. -mv ref/footnote.html ref/footnode.html
  208. -rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  209. -rm -f ref/images.* ref/*.log ref/WARNINGS
  210. touch ref.chk
  211. prog: prog.chk
  212. prog.chk: prog.tex date.inc
  213. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  214. -t "Free Pascal programmers guide" prog.tex
  215. -sed -f foot.sed <prog/footnode.html >prog/footnote.html
  216. -mv prog/footnote.html prog/footnode.html
  217. -rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  218. -rm -f prog/images.* prog/*.log prog/WARNINGS
  219. touch prog.chk
  220. internal: internal.chk
  221. internal.chk: internal.tex date.inc
  222. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  223. -t "Free Pascal Compiler Documentation" internal.tex
  224. -sed -f foot.sed <internal/footnode.html >internal/footnote.html
  225. -mv internal/footnote.html internal/footnode.html
  226. -rm -f internal/labels.pl internal/internals.pl internal/.*.pag internal/.*.dir
  227. -rm -f internal/images.* internal/*.log internal/WARNINGS
  228. touch internal.chk
  229. html: $(HTML)
  230. #####################################################################
  231. # Installation
  232. #####################################################################
  233. install:
  234. install -d -m 755 $(DOCINSTALLDIR)
  235. cp fpctoc.html $(DOCINSTALLDIR)
  236. cp -R buttons $(DOCINSTALLDIR)
  237. cp -R $(HTML) $(DOCINSTALLDIR)
  238. www-install: psdist htmldist htm
  239. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  240. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  241. #####################################################################
  242. # Archives
  243. #####################################################################
  244. psdist: $(PS)
  245. tar -cvzf fpcdocps.tar.gz $(PS)
  246. zip docs-ps $(PS)
  247. pdfdist: pdf
  248. zip docs-pdf $(PDF)
  249. dvidist: dvi
  250. zip docs-dvi $(DVI)
  251. htmldist: html
  252. find . -name '*.html' -or -name '*.gif' -or -name '*.css' >htmllist
  253. find . -name '*.class' >>htmllist
  254. tar -czf fpcdoc.tar.gz --files-from=htmllist
  255. rm -f htmllist
  256. htm: html
  257. makehtm `find . -name '*.html'`
  258. zip -q docs-htm `find . -name '*.htm' -or -name '*.gif' -or -name '*.css'`
  259. rm `find -name '*.htm'`
  260. htmdist: htm
  261. txtdist: txt
  262. zip docs-txt $(TXT)
  263. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  264. distclean: clean
  265. -rm -f *.tar.gz *.zip
  266. #####################################################################
  267. # Examples
  268. #####################################################################
  269. examples:
  270. $(MAKE) -C crtex
  271. $(MAKE) -C dosex
  272. $(MAKE) -C optex
  273. $(MAKE) -C printex
  274. $(MAKE) -C refex
  275. $(MAKE) -C stringex
  276. $(MAKE) -C ipcex
  277. $(MAKE) -C objectex
  278. $(MAKE) -C sysutex
  279. dosexamples: examples
  280. $(MAKE) -C go32ex
  281. $(MAKE) -C mouseex
  282. linuxexamples: examples
  283. $(MAKE) -C linuxex
  284. $(MAKE) -C sockex
  285. $(MAKE) -C ipcex
  286. #
  287. # $Log$
  288. # Revision 1.24 1999-06-03 00:06:42 peter
  289. # * html creation works again
  290. #
  291. # Revision 1.23 1999/06/02 17:41:33 peter
  292. # * fixes for html creation
  293. #
  294. # Revision 1.22 1999/05/31 16:37:08 peter
  295. # * fixes for html creation
  296. #
  297. # Revision 1.21 1999/05/28 19:59:37 michael
  298. # Additional changes
  299. #
  300. # Revision 1.20 1999/04/10 14:57:43 michael
  301. # + Added sysutils
  302. #
  303. # Revision 1.19 1999/02/12 14:15:00 michael
  304. # * Last-minute changes so it can be texed
  305. #
  306. # Revision 1.18 1999/02/02 22:47:04 michael
  307. # + Better clean
  308. #
  309. # Revision 1.17 1999/01/17 15:12:50 michael
  310. # Added examples 27-40
  311. #
  312. # Revision 1.16 1998/12/15 23:50:53 michael
  313. # * Some updates
  314. #
  315. # Revision 1.15 1998/11/17 23:42:02 michael
  316. # + too many changes to enumerate
  317. #
  318. # Revision 1.14 1998/10/01 12:57:22 michael
  319. # + Correction in dependencies
  320. #
  321. # Revision 1.13 1998/09/13 19:26:13 michael
  322. # + Added messages target
  323. #
  324. # Revision 1.12 1998/09/13 12:42:05 michael
  325. # Added error messages and used listings package for program examples
  326. #
  327. # Revision 1.11 1998/09/11 12:08:07 michael
  328. # Additional cleans
  329. #
  330. # Revision 1.10 1998/09/11 11:01:10 peter
  331. # * export a TMP=/tmp for dvips which don't like '.' in the directory
  332. #
  333. #