Makefile 14 KB

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