Makefile 15 KB

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