Makefile 14 KB

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