Makefile 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  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-$(shell ppc386 -iV)
  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 = /usr/bin/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 4.0 -split 3 -image_type gif
  46. endif
  47. # Icons for latex2html
  48. ICONSERVER=../buttons
  49. export ICONSERVER
  50. # Ascii mode ? (i.e. no pics)
  51. ifndef ASCIIMODE
  52. ASCIIMODE=NO
  53. #ASCIIMODE=YES
  54. endif
  55. # DVI to PS converter
  56. ifndef DVIPS
  57. DVIPS=dvips
  58. endif
  59. # DVI to TXT converter
  60. ifndef DVITXT
  61. DVITXT=dvi2tty -w132
  62. endif
  63. # PDF converter
  64. ifndef PDFLATEX
  65. PDFLATEX=pdflatex
  66. endif
  67. # Makeindex programma
  68. ifndef MAKEINDEX
  69. MAKEINDEX=makeindex
  70. endif
  71. # tmpdir
  72. export TMP=/tmp
  73. #
  74. #######################################################################
  75. # End of configurable section. Do not edit after this line.
  76. #######################################################################
  77. PS = $(addsuffix .ps, $(HTML))
  78. DVI = $(addsuffix .dvi, $(HTML))
  79. TXT = $(addsuffix .txt, $(HTML))
  80. PDF = $(addsuffix .pdf, $(HTML))
  81. TOC = $(addsuffix .toc, $(HTML) onechap)
  82. AUX = $(addsuffix .aux, $(HTML) onechap)
  83. LOG = $(addsuffix .log, $(HTML) onechap)
  84. LOT = $(addsuffix .lot, $(HTML) onechap)
  85. OUT = $(addsuffix .out, $(HTML) onechap)
  86. CHK = $(addsuffix .chk, $(HTML) progex unitex refex htex onechap)
  87. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer\
  88. strings objects heaptrc sysutils ipc mouse gpm dxeload \
  89. emu387 ports math)
  90. # Check if ascii-mode requested
  91. ifeq ($(ASCIIMODE),YES)
  92. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  93. endif
  94. #####################################################################
  95. # Conversion from types
  96. #####################################################################
  97. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  98. htm txt pdf refex alldist messages onechap
  99. .SUFFIXES: .dvi .tex .ps .txt .pdf
  100. # default show help
  101. .dvi.ps:
  102. $(DVIPS) $<
  103. .tex.dvi:
  104. $(LATEX) $*
  105. -$(MAKEINDEX) $*
  106. $(LATEX) $*
  107. -$(MAKEINDEX) $*
  108. $(LATEX) $*
  109. .dvi.txt:
  110. $(DVITXT) -o $*.txt $*.dvi
  111. .tex.pdf:
  112. $(PDFLATEX) $*
  113. -$(MAKEINDEX) $*
  114. $(PDFLATEX) $*
  115. -$(MAKEINDEX) $*
  116. $(PDFLATEX) $*
  117. #####################################################################
  118. # Targets
  119. #####################################################################
  120. help:
  121. @echo 'Possible targets :'
  122. @echo ' dvi : Make documentation using latex.'
  123. @echo ' ps : Make documentation using latex and dvips.'
  124. @echo ' html : Make documentation using latex2html.'
  125. @echo ' pdf : Make documentation using pdflatex'
  126. @echo ' txt : dvi, convert to text using dvi2tty'
  127. @echo ' htm : Convert .html to .htm files, zip result'
  128. @echo ' clean : Clean up the mess.'
  129. @echo ' linuxexamples : Compile all examples for linux'
  130. @echo ' dosexamples : Compile all examples for dos'
  131. @echo ' htmldist : html, and rchive result.'
  132. @echo ' psdist : ps, and archive result.'
  133. @echo ' pdfdist : pdf, and archive result.'
  134. clean:
  135. -rm -f *.htex
  136. -rm -rf $(HTML) onechap
  137. -rm -f $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) *.i* $(LOT) $(TXT) $(CHK)
  138. # Units
  139. -$(MAKE) -C crtex clean
  140. -$(MAKE) -C dosex clean
  141. -$(MAKE) -C go32ex clean
  142. -$(MAKE) -C heapex clean
  143. -$(MAKE) -C ipcex clean
  144. -$(MAKE) -C linuxex clean
  145. -$(MAKE) -C mouseex clean
  146. -$(MAKE) -C objectex clean
  147. -$(MAKE) -C optex clean
  148. -$(MAKE) -C printex clean
  149. -$(MAKE) -C sockex clean
  150. -$(MAKE) -C stringex clean
  151. -$(MAKE) -C sysutex clean
  152. # Reference
  153. -$(MAKE) -C refex clean
  154. $(TXT) : %.txt: %.dvi
  155. $(DVI) : %.dvi: %.tex
  156. $(PDF) : %.pdf: %.tex
  157. unitex.chk:
  158. ifndef INSTALLDEBUG
  159. $(MAKE) -C crtex tex
  160. $(MAKE) -C dosex tex
  161. $(MAKE) -C go32ex tex
  162. $(MAKE) -C heapex tex
  163. $(MAKE) -C ipcex tex
  164. $(MAKE) -C linuxex tex
  165. $(MAKE) -C mouseex tex
  166. $(MAKE) -C objectex tex
  167. $(MAKE) -C optex tex
  168. $(MAKE) -C printex tex
  169. $(MAKE) -C sockex tex
  170. $(MAKE) -C stringex tex
  171. $(MAKE) -C sysutex tex
  172. endif
  173. touch unitex.chk
  174. refex.chk:
  175. ifndef INSTALLDEBUG
  176. $(MAKE) -C refex tex
  177. endif
  178. touch refex.chk
  179. progex.chk:
  180. ifndef INSTALLDEBUG
  181. $(MAKE) -C progex tex
  182. endif
  183. touch progex.chk
  184. messages:
  185. msg2inc -TE ../compiler/errore.msg messages.tex
  186. date.inc:
  187. @echo \\date\{`date +'%B %Y'`\} > date.inc
  188. onechap: onechap.dvi
  189. units.dvi: units.tex date.inc $(CHAPTERS)
  190. ref.dvi: ref.tex date.inc
  191. prog.dvi: prog.tex date.inc
  192. user.dvi: user.tex date.inc
  193. units.pdf: units.tex date.inc $(CHAPTERS)
  194. ref.pdf: ref.tex date.inc
  195. user.pdf: user.tex date.inc
  196. prog.pdf: prog.tex date.inc
  197. dvi : $(DVI)
  198. txt : dvi $(TXT)
  199. ps : dvi $(PS)
  200. pdf : $(PDF)
  201. all : dvi ps pdf txt html
  202. #####################################################################
  203. # Html creation
  204. #####################################################################
  205. htex: htex.chk
  206. htex.chk: $(wildcard *.tex)
  207. ./tex2htex
  208. touch htex.chk
  209. user: user.chk
  210. user.chk: htex.chk date.inc
  211. ifdef INSTALLDEBUG
  212. mkdir user
  213. cp user.tex user/index.html
  214. else
  215. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  216. -t "User's guide for Free Pascal" user.htex
  217. -sed -f foot.sed <user/footnode.html >user/footnote.html
  218. -mv user/footnote.html user/footnode.html
  219. -rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  220. -rm -f user/images.* user/*.log user/WARNINGS
  221. endif
  222. touch user.chk
  223. units: units.chk
  224. units.chk: unitex.chk htex.chk date.inc
  225. ifdef INSTALLDEBUG
  226. mkdir units
  227. cp units.tex units/index.html
  228. else
  229. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  230. -t "Unit reference for Free Pascal" units.htex
  231. -sed -f foot.sed <units/footnode.html >units/footnote.html
  232. -mv units/footnote.html units/footnode.html
  233. -rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  234. -rm -f units/images.* units/*.log units/WARNINGS
  235. endif
  236. touch units.chk
  237. ref: ref.chk
  238. ref.chk: refex.chk htex.chk date.inc
  239. ifdef INSTALLDEBUG
  240. mkdir ref
  241. cp ref.tex ref/index.html
  242. else
  243. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  244. -t "Free Pascal reference guide" ref.htex
  245. -sed -f foot.sed <ref/footnode.html >ref/footnote.html
  246. -mv ref/footnote.html ref/footnode.html
  247. -rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  248. -rm -f ref/images.* ref/*.log ref/WARNINGS
  249. endif
  250. touch ref.chk
  251. prog: prog.chk
  252. prog.chk: progex.chk htex.chk date.inc
  253. ifdef INSTALLDEBUG
  254. mkdir prog
  255. cp prog.tex prog/index.html
  256. else
  257. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  258. -t "Free Pascal programmers guide" prog.htex
  259. -sed -f foot.sed <prog/footnode.html >prog/footnote.html
  260. -mv prog/footnote.html prog/footnode.html
  261. -rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  262. -rm -f prog/images.* prog/*.log prog/WARNINGS
  263. endif
  264. touch prog.chk
  265. internal: internal.chk
  266. internal.chk: htex.chk date.inc
  267. ifdef INSTALLDEBUG
  268. mkdir internal
  269. cp internal.tex internal/index.html
  270. else
  271. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  272. -t "Free Pascal Compiler Documentation" internal.htex
  273. -sed -f foot.sed <internal/footnode.html >internal/footnote.html
  274. -mv internal/footnote.html internal/footnode.html
  275. -rm -f internal/labels.pl internal/internals.pl internal/.*.pag internal/.*.dir
  276. -rm -f internal/images.* internal/*.log internal/WARNINGS
  277. endif
  278. touch internal.chk
  279. onechap: onechap.chk
  280. onechap.chk: unitex.chk htex.chk date.inc
  281. ifdef INSTALLDEBUG
  282. mkdir onechap
  283. cp onechap.tex onechap/index.html
  284. else
  285. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  286. -t "Free Pascal reference guide" onechap.htex
  287. -sed -f foot.sed <onechap/footnode.html >onechap/footnote.html
  288. -mv onechap/footnote.html onechap/footnode.html
  289. -rm -f onechap/labels.pl onechap/internals.pl onechap/.*.pag onechap/.*.dir
  290. -rm -f onechap/images.* onechap/*.log onechap/WARNINGS
  291. endif
  292. touch onechap.chk
  293. html: $(HTML)
  294. #####################################################################
  295. # Installation
  296. #####################################################################
  297. pdfinstall: pdf
  298. install -d -m 755 $(DOCINSTALLDIR)
  299. cp $(PDF) $(DOCINSTALLDIR)
  300. htmlinstall: html
  301. install -d -m 755 $(DOCINSTALLDIR)
  302. cp fpctoc.html $(DOCINSTALLDIR)
  303. cp -R buttons $(DOCINSTALLDIR)
  304. cp -R search $(DOCINSTALLDIR)
  305. sed s/DOCDIR/"$(subst /,\/,$(DOCINSTALLDIR))"/ $(DOCINSTALLDIR)/search/fpchelp.idksm.linux > $(DOCINSTALLDIR)/search/fpchelp.idksm
  306. cp -f $(DOCINSTALLDIR)/search/filelist.txt.linux $(DOCINSTALLDIR)/search/filelist.txt
  307. rm -f $(DOCINSTALLDIR)/search/*.linux
  308. cp -R $(HTML) $(DOCINSTALLDIR)
  309. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  310. doshtmlinstall: html
  311. install -d -m 755 $(DOCINSTALLDIR)
  312. cp fpctoc.html $(DOCINSTALLDIR)
  313. cp -R buttons $(DOCINSTALLDIR)
  314. cp -R search $(DOCINSTALLDIR)
  315. rm -f $(DOCINSTALLDIR)/search/*.linux
  316. cp -R $(HTML) $(DOCINSTALLDIR)
  317. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  318. www-install: psdist htmlinstall
  319. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  320. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  321. install:
  322. @echo Choose install from:
  323. @echo pdfinstall,htmlinstall,htmldosinstall
  324. @exit
  325. #####################################################################
  326. # Archives
  327. #####################################################################
  328. psdist: $(PS)
  329. tar -cvzf fpcdocps.tar.gz $(PS)
  330. zip docs-ps $(PS)
  331. pdfdist: pdf
  332. zip docs-pdf $(PDF)
  333. dvidist: dvi
  334. zip docs-dvi $(DVI)
  335. txtdist: txt
  336. zip docs-txt $(TXT)
  337. #####################################################################
  338. # Zips of htmls
  339. #####################################################################
  340. DOCPREFIX=doc
  341. BASEDIR=$(shell pwd)
  342. htmltar:
  343. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  344. cd $(DOCPREFIX) ; tar cz * > $(BASEDIR)/fpcdoc.tar.gz ; cd $(BASEDIR)
  345. rm -rf $(DOCPREFIX)
  346. htmlzip:
  347. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  348. zip -D9rq doc-html $(DOCPREFIX)/*
  349. rm -rf $(DOCPREFIX)
  350. htmzip:
  351. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  352. makehtm `find $(DOCPREFIX) -name '*.html'`
  353. zip -D9rq doc-htm `find $(DOCPREFIX) -name '*.htm' -or -name '*.gif' -or -name '*.css'`
  354. rm -rf $(DOCPREFIX)
  355. htmldist: htmlzip htmltar
  356. htmdist: htmzip
  357. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  358. distclean: clean
  359. -rm -f *.tar.gz *.zip
  360. #####################################################################
  361. # Examples
  362. #####################################################################
  363. examples:
  364. $(MAKE) -C crtex
  365. $(MAKE) -C dosex
  366. $(MAKE) -C optex
  367. $(MAKE) -C printex
  368. $(MAKE) -C refex
  369. $(MAKE) -C stringex
  370. $(MAKE) -C ipcex
  371. $(MAKE) -C objectex
  372. $(MAKE) -C sysutex
  373. dosexamples: examples
  374. $(MAKE) -C go32ex
  375. $(MAKE) -C mouseex
  376. linuxexamples: examples
  377. $(MAKE) -C linuxex
  378. $(MAKE) -C sockex
  379. $(MAKE) -C ipcex
  380. #
  381. # $Log$
  382. # Revision 1.3 2000-09-02 21:51:36 peter
  383. # * fixed pdf creating (merged)
  384. #
  385. # Revision 1.1.2.1 2000/09/02 17:29:51 peter
  386. # * example including for html docs
  387. #
  388. # Revision 1.1 2000/07/13 09:10:03 michael
  389. # + Initial import
  390. #
  391. # Revision 1.40 2000/07/11 18:07:26 peter
  392. # * fixes for latex2html 0.99b2
  393. #
  394. # Revision 1.39 2000/07/09 15:44:15 peter
  395. # * image_type gif added
  396. #
  397. # Revision 1.38 2000/07/04 21:23:04 michael
  398. # + Added math unit
  399. #
  400. # Revision 1.37 2000/07/04 19:55:48 michael
  401. # + Added ports unit
  402. #
  403. # Revision 1.36 2000/06/14 19:38:43 michael
  404. # + Added gpm units, and corrected L2H options
  405. #
  406. # Revision 1.35 2000/02/20 16:27:38 peter
  407. # * htmlinstall fixes
  408. #
  409. # Revision 1.33 2000/01/23 20:15:16 peter
  410. # * rpm/deb target in install dir
  411. # * install also faq,readme,news for rpm/deb
  412. #
  413. # Revision 1.32 2000/01/14 12:16:40 peter
  414. # * package generation fixes
  415. #
  416. # Revision 1.31 2000/01/11 09:55:36 peter
  417. # * docinstalldir is now calculated by asking ppc386 -iV
  418. #
  419. # Revision 1.30 1999/07/29 21:03:41 peter
  420. # * html 3.2, because 3.1 is buggy !!
  421. #
  422. # Revision 1.29 1999/07/16 10:15:31 peter
  423. # * install targets renamed
  424. #
  425. # Revision 1.28 1999/06/25 22:12:10 michael
  426. # + Update to version 0.19 of listings package
  427. #
  428. # Revision 1.27 1999/06/15 13:53:16 peter
  429. # * htmlzip,htmzip,htmltar updates
  430. # * include search/ in distro
  431. # * fix paths under linux automaticly
  432. #
  433. # Revision 1.26 1999/06/08 22:11:28 peter
  434. # * debian updates
  435. #
  436. # Revision 1.25 1999/06/08 18:28:13 peter
  437. # * fixes for 0.99.12 release
  438. #
  439. # Revision 1.24 1999/06/03 00:06:42 peter
  440. # * html creation works again
  441. #
  442. # Revision 1.23 1999/06/02 17:41:33 peter
  443. # * fixes for html creation
  444. #
  445. # Revision 1.22 1999/05/31 16:37:08 peter
  446. # * fixes for html creation
  447. #
  448. # Revision 1.21 1999/05/28 19:59:37 michael
  449. # Additional changes
  450. #
  451. # Revision 1.20 1999/04/10 14:57:43 michael
  452. # + Added sysutils
  453. #
  454. # Revision 1.19 1999/02/12 14:15:00 michael
  455. # * Last-minute changes so it can be texed
  456. #
  457. # Revision 1.18 1999/02/02 22:47:04 michael
  458. # + Better clean
  459. #
  460. # Revision 1.17 1999/01/17 15:12:50 michael
  461. # Added examples 27-40
  462. #
  463. # Revision 1.16 1998/12/15 23:50:53 michael
  464. # * Some updates
  465. #
  466. # Revision 1.15 1998/11/17 23:42:02 michael
  467. # + too many changes to enumerate
  468. #
  469. # Revision 1.14 1998/10/01 12:57:22 michael
  470. # + Correction in dependencies
  471. #
  472. # Revision 1.13 1998/09/13 19:26:13 michael
  473. # + Added messages target
  474. #
  475. # Revision 1.12 1998/09/13 12:42:05 michael
  476. # Added error messages and used listings package for program examples
  477. #
  478. # Revision 1.11 1998/09/11 12:08:07 michael
  479. # Additional cleans
  480. #
  481. # Revision 1.10 1998/09/11 11:01:10 peter
  482. # * export a TMP=/tmp for dvips which don't like '.' in the directory
  483. #
  484. #