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