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