Makefile 12 KB

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