Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  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. # Can be 'report','book' or 'html'
  24. PREAMBLETYPE = report
  25. # Where do you want the html files to be put ?
  26. ifndef PREFIXINSTALLDIR
  27. PREFIXINSTALLDIR=/usr
  28. endif
  29. ifndef DOCINSTALLDIR
  30. DOCINSTALLDIR:=$(PREFIXINSTALLDIR)/doc/fpc-$(shell ppc386 -iV)
  31. endif
  32. FPDOC=/home/michael/projects/fpdoc/fpdoc
  33. #
  34. # Program definitions
  35. #
  36. # Latex
  37. ifndef LATEX
  38. LATEX = latex
  39. endif
  40. # Latex2html conversion.
  41. ifndef LATEX2HTML
  42. LATEX2HTML = /usr/bin/latex2html
  43. endif
  44. # Options for converter
  45. ifndef LATEX2HTMLOPTS
  46. LATEX2HTMLOPTS = -no_reuse -up_url "../fpctoc.html"\
  47. -up_title "Free Pascal manuals"\
  48. -html_version 4.0 -split 3
  49. endif
  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 scripts)
  87. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer\
  88. strings objects heaptrc sysutils ipc mouse gpm dxeload \
  89. emu387 ports math keyboard typinfo video)
  90. FCLCHAPTERS = $(addsuffix .tex, classes)
  91. GTKPDF=$(addsuffix .pdf,$(addprefix gtk, 1 2 3 4 5))
  92. # Check if ascii-mode requested
  93. ifeq ($(ASCIIMODE),YES)
  94. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  95. endif
  96. #####################################################################
  97. # Conversion from types
  98. #####################################################################
  99. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  100. htm txt pdf refex alldist messages onechap gtk \
  101. user ref prog units
  102. .SUFFIXES: .dvi .tex .ps .txt .pdf
  103. # default show help
  104. .dvi.ps:
  105. $(DVIPS) $<
  106. .tex.dvi:
  107. $(LATEX) $*
  108. -$(MAKEINDEX) $*
  109. $(LATEX) $*
  110. -$(MAKEINDEX) $*
  111. $(LATEX) $*
  112. .dvi.txt:
  113. $(DVITXT) -o $*.txt $*.dvi
  114. .tex.pdf:
  115. $(PDFLATEX) $*
  116. -$(MAKEINDEX) $*
  117. $(PDFLATEX) $*
  118. -$(MAKEINDEX) $*
  119. $(PDFLATEX) $*
  120. #####################################################################
  121. # Targets
  122. #####################################################################
  123. help:
  124. @echo 'Possible targets :'
  125. @echo ' dvi : Make documentation using latex.'
  126. @echo ' ps : Make documentation using latex and dvips.'
  127. @echo ' html : Make documentation using latex2html.'
  128. @echo ' pdf : Make documentation using pdflatex'
  129. @echo ' txt : dvi, convert to text using dvi2tty'
  130. @echo ' htm : Convert .html to .htm files, zip result'
  131. @echo ' clean : Clean up the mess.'
  132. @echo ' examples : Comple all generic examples'
  133. @echo ' linuxexamples : Compile all examples for linux'
  134. @echo ' dosexamples : Compile all examples for dos'
  135. @echo ' execute : Execute examples (DOS/Windows/OS/2 only)'
  136. @echo ' htmldist : html, and rchive result.'
  137. @echo ' psdist : ps, and archive result.'
  138. @echo ' pdfdist : pdf, and archive result.'
  139. clean:
  140. -rm -f preamble.inc date.inc
  141. -rm -f *.htex
  142. -rm -rf $(HTML) onechap
  143. -rm -f $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) *.i* $(LOT) $(TXT) $(CHK)
  144. -rm -f onechap.dvi onechap.pdf onechap.ps onechap.out onechap.log onechap.aux
  145. # Units
  146. -$(MAKE) -C crtex clean
  147. -$(MAKE) -C dosex clean
  148. -$(MAKE) -C go32ex clean
  149. -$(MAKE) -C heapex clean
  150. -$(MAKE) -C ipcex clean
  151. -$(MAKE) -C linuxex clean
  152. -$(MAKE) -C mmouseex clean
  153. -$(MAKE) -C mouseex clean
  154. -$(MAKE) -C objectex clean
  155. -$(MAKE) -C optex clean
  156. -$(MAKE) -C printex clean
  157. -$(MAKE) -C sockex clean
  158. -$(MAKE) -C stringex clean
  159. -$(MAKE) -C sysutex clean
  160. -$(MAKE) -C mathex clean
  161. -$(MAKE) -C graphex clean
  162. -$(MAKE) -C gpmex clean
  163. -$(MAKE) -C typinfex clean
  164. -$(MAKE) -C kbdex clean
  165. -$(MAKE) -C videoex clean
  166. # Reference
  167. -$(MAKE) -C refex clean
  168. # Programmers manual
  169. -$(MAKE) -C progex clean
  170. $(TXT) : %.txt: %.dvi
  171. $(DVI) : %.dvi: %.tex
  172. $(PDF) : %.pdf: %.tex
  173. unitex.chk:
  174. ifndef INSTALLDEBUG
  175. $(MAKE) -C crtex tex
  176. $(MAKE) -C dosex tex
  177. $(MAKE) -C go32ex tex
  178. $(MAKE) -C heapex tex
  179. $(MAKE) -C ipcex tex
  180. $(MAKE) -C linuxex tex
  181. $(MAKE) -C mouseex tex
  182. $(MAKE) -C mmouseex tex
  183. $(MAKE) -C objectex tex
  184. $(MAKE) -C optex tex
  185. $(MAKE) -C printex tex
  186. $(MAKE) -C sockex tex
  187. $(MAKE) -C stringex tex
  188. $(MAKE) -C sysutex tex
  189. $(MAKE) -C mathex tex
  190. $(MAKE) -C graphex tex
  191. $(MAKE) -C gpmex tex
  192. $(MAKE) -C kbdex tex
  193. $(MAKE) -C typinfex tex
  194. $(MAKE) -C videoex tex
  195. endif
  196. touch unitex.chk
  197. refex.chk:
  198. ifndef INSTALLDEBUG
  199. $(MAKE) -C refex tex
  200. endif
  201. touch refex.chk
  202. progex.chk:
  203. ifndef INSTALLDEBUG
  204. $(MAKE) -C progex tex
  205. endif
  206. touch progex.chk
  207. messages:
  208. msg2inc -TE ../compiler/errore.msg messages.tex
  209. #
  210. # Include files
  211. #
  212. date.inc:
  213. @echo \\date\{`date +'%B %Y'`\} > date.inc
  214. preamble.inc:
  215. cp -f preamble.$(PREAMBLETYPE) preamble.inc
  216. ifeq ($(OS),Windows_NT)
  217. inWinNT=1
  218. endif
  219. ifndef inWinNT
  220. scripts.chk:
  221. chmod +x tex2htex
  222. chmod +x pp2tex
  223. chmod +x progex/c2tex
  224. touch scripts.chk
  225. endif
  226. ifndef inWinNT
  227. includes: date.inc preamble.inc scripts.chk
  228. else
  229. includes: date.inc preamble.inc
  230. endif
  231. #####################################################################
  232. # Tex from XML
  233. #####################################################################
  234. FPCLASSESOPT=--package=fcl --descr=classes.xml --input='../fcl/linux/classes.pp -I../fcl/inc'
  235. classes.tex: classes.xml
  236. $(FPDOC) --output=. $(FPCLASSESOPT) --format=latex
  237. #####################################################################
  238. # DVI files
  239. #####################################################################
  240. onechap: onechap.dvi
  241. units.dvi: units.tex includes $(CHAPTERS)
  242. ref.dvi: ref.tex includes
  243. prog.dvi: prog.tex includes
  244. user.dvi: user.tex includes
  245. units.pdf: units.tex includes $(CHAPTERS)
  246. ref.pdf: ref.tex includes
  247. user.pdf: user.tex includes
  248. prog.pdf: prog.tex includes
  249. onechap.pdf: onechap.tex includes
  250. onechap.dvi: onechap.tex includes
  251. dvi : $(DVI)
  252. txt : dvi $(TXT)
  253. ps : dvi $(PS)
  254. pdf : $(PDF)
  255. all : dvi ps pdf txt html
  256. #####################################################################
  257. # Html creation
  258. #####################################################################
  259. htex: htex.chk
  260. htex.chk: $(wildcard *.tex) includes
  261. ./tex2htex
  262. touch htex.chk
  263. user: user.chk
  264. user.chk: htex.chk includes
  265. ifdef INSTALLDEBUG
  266. mkdir user
  267. cp user.tex user/index.html
  268. else
  269. cp -f preamble.html preamble.inc
  270. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  271. -t "User's guide for Free Pascal" user.htex
  272. -sed -f foot.sed <user/footnode.html >user/footnote.html
  273. -mv user/footnote.html user/footnode.html
  274. -rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  275. -rm -f user/images.* user/*.log user/WARNINGS
  276. endif
  277. touch user.chk
  278. units: units.chk
  279. units.chk: unitex.chk htex.chk includes
  280. ifdef INSTALLDEBUG
  281. mkdir units
  282. cp units.tex units/index.html
  283. else
  284. cp -f preamble.html preamble.inc
  285. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  286. -t "Unit reference for Free Pascal" units.htex
  287. -sed -f foot.sed <units/footnode.html >units/footnote.html
  288. -mv units/footnote.html units/footnode.html
  289. ifndef DEBUG
  290. -rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  291. -rm -f units/images.* units/*.log units/WARNINGS
  292. endif
  293. endif
  294. touch units.chk
  295. ref: ref.chk
  296. ref.chk: refex.chk htex.chk includes
  297. ifdef INSTALLDEBUG
  298. mkdir ref
  299. cp ref.tex ref/index.html
  300. else
  301. cp -f preamble.html preamble.inc
  302. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  303. -t "Free Pascal reference guide" ref.htex
  304. -sed -f foot.sed <ref/footnode.html >ref/footnote.html
  305. -mv ref/footnote.html ref/footnode.html
  306. ifndef DEBUG
  307. -rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  308. -rm -f ref/images.* ref/*.log ref/WARNINGS
  309. endif
  310. endif
  311. touch ref.chk
  312. prog: prog.chk
  313. prog.chk: progex.chk htex.chk includes
  314. ifdef INSTALLDEBUG
  315. mkdir prog
  316. cp prog.tex prog/index.html
  317. else
  318. cp -f preamble.html preamble.inc
  319. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  320. -t "Free Pascal programmers guide" prog.htex
  321. -sed -f foot.sed <prog/footnode.html >prog/footnote.html
  322. -mv prog/footnote.html prog/footnode.html
  323. ifndef DEBUG
  324. -rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  325. -rm -f prog/images.* prog/*.log prog/WARNINGS
  326. endif
  327. endif
  328. touch prog.chk
  329. internal: internal.chk
  330. internal.chk: htex.chk
  331. ifdef INSTALLDEBUG
  332. mkdir internal
  333. cp internal.tex internal/index.html
  334. else
  335. cp -f preamble.html preamble.inc
  336. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  337. -t "Free Pascal Compiler Documentation" internal.htex
  338. -sed -f foot.sed <internal/footnode.html >internal/footnote.html
  339. -mv internal/footnote.html internal/footnode.html
  340. ifndef DEBUG
  341. -rm -f internal/labels.pl internal/internals.pl internal/.*.pag internal/.*.dir
  342. -rm -f internal/images.* internal/*.log internal/WARNINGS
  343. endif
  344. endif
  345. touch internal.chk
  346. onechap: onechap.chk
  347. onechap.chk: unitex.chk htex.chk includes
  348. ifdef INSTALLDEBUG
  349. mkdir onechap
  350. cp onechap.tex onechap/index.html
  351. else
  352. cp -f preamble.html preamble.inc
  353. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  354. -t "Free Pascal reference guide" onechap.htex
  355. -sed -f foot.sed <onechap/footnode.html >onechap/footnote.html
  356. -mv onechap/footnote.html onechap/footnode.html
  357. ifndef DEBUG
  358. -rm -f onechap/labels.pl onechap/internals.pl onechap/.*.pag onechap/.*.dir
  359. -rm -f onechap/images.* onechap/*.log onechap/WARNINGS
  360. endif
  361. endif
  362. touch onechap.chk
  363. html: $(HTML)
  364. classes: classes/index.html
  365. classes/index.html: classes.xml
  366. $(FPDOC) $(FPCLASSESOPT) --format=html
  367. #####################################################################
  368. # GTK Articles
  369. #####################################################################
  370. gtk: $(GTKPDF)
  371. gtk1.pdf: gtk1.tex
  372. gtk2.pdf: gtk2.tex
  373. gtk3.pdf: gtk3.tex
  374. gtk4.pdf: gtk4.tex
  375. gtk5.pdf: gtk5.tex
  376. #####################################################################
  377. # Installation
  378. #####################################################################
  379. pdfinstall: pdf
  380. install -d -m 755 $(DOCINSTALLDIR)
  381. cp $(PDF) $(DOCINSTALLDIR)
  382. htmlinstall: html
  383. install -d -m 755 $(DOCINSTALLDIR)
  384. cp fpctoc.html $(DOCINSTALLDIR)
  385. cp -R buttons $(DOCINSTALLDIR)
  386. cp -R pics $(DOCINSTALLDIR)
  387. cp -R $(HTML) $(DOCINSTALLDIR)
  388. find $(DOCINSTALLDIR) -name 'CVS' -or -name '*.eps' | xargs -n1 rm -rf
  389. install:
  390. @echo Choose install from:
  391. @echo pdfinstall,htmlinstall,htmldosinstall
  392. @exit
  393. #####################################################################
  394. # Archives
  395. #####################################################################
  396. psdist: $(PS)
  397. tar -cvzf fpcdocps.tar.gz $(PS)
  398. zip docs-ps $(PS)
  399. pdfdist: pdf
  400. zip docs-pdf $(PDF)
  401. dvidist: dvi
  402. zip docs-dvi $(DVI)
  403. txtdist: txt
  404. zip docs-txt $(TXT)
  405. #####################################################################
  406. # Zips of htmls
  407. #####################################################################
  408. DOCPREFIX=doc
  409. BASEDIR=$(shell pwd)
  410. htmltar:
  411. ifndef SKIPINSTALL
  412. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  413. endif
  414. cd $(DOCPREFIX) ; tar cz * > $(BASEDIR)/fpcdoc.tar.gz ; cd $(BASEDIR)
  415. rm -rf $(DOCPREFIX)
  416. htmlzip:
  417. ifndef SKIPINSTALL
  418. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  419. endif
  420. zip -D9rq doc-html $(DOCPREFIX)/*
  421. rm -rf $(DOCPREFIX)
  422. htmzip:
  423. ifndef SKIPINSTALL
  424. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  425. endif
  426. makehtm `find $(DOCPREFIX) -name '*.html'`
  427. zip -D9rq doc-htm `find $(DOCPREFIX) -name '*.htm' -or -name '*.gif' -or -name '*.png' -or -name '*.css'`
  428. rm -rf $(DOCPREFIX)
  429. htmldist: htmlzip htmltar
  430. htmdist: htmzip
  431. alldist: dvidist psdist txtdist pdfdist
  432. $(MAKE) htmltar
  433. $(MAKE) htmlzip SKIPINSTALL=Y
  434. $(MAKE) htmzip SKIPINSTALL=Y
  435. distclean: clean
  436. -rm -f *.tar.gz *.zip
  437. #####################################################################
  438. # Examples
  439. #####################################################################
  440. examples:
  441. $(MAKE) -C crtex
  442. $(MAKE) -C dosex
  443. $(MAKE) -C optex
  444. $(MAKE) -C mathex
  445. $(MAKE) -C printex
  446. $(MAKE) -C refex
  447. $(MAKE) -C stringex
  448. $(MAKE) -C objectex
  449. $(MAKE) -C sysutex
  450. $(MAKE) -C typinfex
  451. $(MAKE) -C kbdex
  452. dosexamples: examples
  453. $(MAKE) -C go32ex
  454. $(MAKE) -C mouseex
  455. linuxexamples: examples
  456. $(MAKE) -C linuxex
  457. $(MAKE) -C sockex
  458. $(MAKE) -C ipcex
  459. execute:
  460. $(MAKE) -C dosex all
  461. $(MAKE) -C dosex execute
  462. $(MAKE) -C refex all
  463. $(MAKE) -C refex execute
  464. $(MAKE) -C mathex all
  465. $(MAKE) -C mathex execute
  466. $(MAKE) -C stringex all
  467. $(MAKE) -C stringex execute
  468. $(MAKE) -C objectex all
  469. $(MAKE) -C objectex execute
  470. $(MAKE) -C sysutex all
  471. $(MAKE) -C sysutex execute
  472. $(MAKE) -C typinfex all
  473. $(MAKE) -C typinfex execute
  474. #
  475. # $Log$
  476. # Revision 1.16 2003-02-24 23:37:52 michael
  477. # + Preparations for version 1.0.8
  478. #
  479. # Revision 1.15 2002/11/10 12:22:10 carl
  480. # * update makefiles for testing
  481. # * update example which did not compile
  482. #
  483. # Revision 1.14 2002/04/23 18:03:50 michael
  484. # + removed fcl target in HTML
  485. #
  486. # Revision 1.13 2002/03/19 14:33:18 pierre
  487. # * remove ipcex directory target from examples
  488. #
  489. # Revision 1.12 2002/03/12 22:13:42 michael
  490. # + Now pics directory is included in HTML
  491. #
  492. # Revision 1.11 2001/11/05 20:10:05 michael
  493. # + Added onechap target
  494. #
  495. # Revision 1.10 2001/10/18 21:41:26 peter
  496. # * fixed latex2html settings
  497. #
  498. # Revision 1.9 2001/10/11 23:36:54 carl
  499. # + reinstated Windows NT support
  500. #
  501. # Revision 1.8 2001/10/04 21:03:13 michael
  502. # + Added video and keyboard units
  503. #
  504. # Revision 1.7 2001/09/22 11:15:04 peter
  505. # * chmod the scripts
  506. # * fixed html installation
  507. #
  508. # Revision 1.6 2001/07/29 20:28:00 peter
  509. # * move preamble to separate include file so changes only need to
  510. # be done to this file.
  511. #
  512. # Revision 1.5 2001/07/10 22:01:15 michael
  513. # + Some cleaning up
  514. #
  515. # Revision 1.4 2000/10/12 10:41:58 peter
  516. # * more examples
  517. #
  518. # Revision 1.3 2000/09/02 21:51:36 peter
  519. # * fixed pdf creating (merged)
  520. #
  521. # Revision 1.1 2000/07/13 09:10:03 michael
  522. # + Initial import
  523. #