Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  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)/rtl/$(HOSTOS)/classes.pp -Fi$(FPCSRCDIR)/rtl/objpas/classes'
  279. fcl.inc: classes.xml
  280. $(FPDOC) --output=fcl.inc $(FCLOPTS) --format=latex
  281. #####################################################################
  282. # DVI files
  283. #####################################################################
  284. onechap: onechap.dvi
  285. units.dvi: units.tex includes $(CHAPTERS)
  286. ref.dvi: ref.tex includes
  287. prog.dvi: prog.tex includes
  288. user.dvi: user.tex includes
  289. fpdoc.dvi: fpdoc.tex includes
  290. fcl.dvi: fcl.tex fcl.inc includes
  291. chart.dvi: chart.tex
  292. units.pdf: units.tex includes $(CHAPTERS)
  293. ref.pdf: ref.tex includes
  294. user.pdf: user.tex includes
  295. prog.pdf: prog.tex includes
  296. onechap.pdf: onechap.tex includes
  297. onechap.dvi: onechap.tex includes
  298. fpdoc.pdf: fpdoc.tex includes
  299. fcl.pdf: fcl.tex fcl.inc includes
  300. chart.pdf: chart.tex
  301. dvi : $(DVI)
  302. txt : dvi $(TXT)
  303. ps : dvi $(PS)
  304. pdf : $(PDF)
  305. all : dvi ps pdf txt html
  306. #######################################################################
  307. # HTML creation
  308. #######################################################################
  309. .PHONY: htex user prog units onechap ref internal html hevea
  310. ifdef INSTALLDEBUG
  311. #######################################################################
  312. # Installation debugging
  313. $(HTML):
  314. mkdir $@
  315. cp [email protected] $@/index.html
  316. html: $(HTML)
  317. else
  318. #######################################################################
  319. # Automatic selection. Default tex4ht
  320. ifdef USEHEVEA
  321. include Makefile.hev
  322. else
  323. ifdef USEL2H
  324. include Makefile.l2h
  325. else
  326. include Makefile.4ht
  327. endif # USEL2H
  328. endif # USEHEVEA
  329. endif # INSTALLDEBUG
  330. #######################################################################
  331. # Targets to force using a specific tool.
  332. hevea:
  333. $(MAKE) html USEHEVEA=1
  334. l2h:
  335. $(MAKE) html USEL2H=1
  336. 4ht:
  337. $(MAKE) html USETEX4HT=1
  338. fcl: fcl/index.html
  339. fcl/index.html: classes.xml
  340. $(FPDOC) $(FCLOPTS) --format=html --output=fcl
  341. #####################################################################
  342. # GTK Articles
  343. #####################################################################
  344. gtk: $(GTKPDF)
  345. gtk1.pdf: gtk1.tex
  346. gtk2.pdf: gtk2.tex
  347. gtk3.pdf: gtk3.tex
  348. gtk4.pdf: gtk4.tex
  349. gtk5.pdf: gtk5.tex
  350. #####################################################################
  351. # Installation
  352. #####################################################################
  353. pdfinstall: pdf
  354. install -d -m 755 $(DOCINSTALLDIR)
  355. cp $(PDF) $(DOCINSTALLDIR)
  356. htmlinstall: html
  357. install -d -m 755 $(DOCINSTALLDIR)
  358. cp fpctoc.html $(DOCINSTALLDIR)
  359. cp -R buttons $(DOCINSTALLDIR)
  360. cp -R pics $(DOCINSTALLDIR)
  361. cp -R $(HTML) $(DOCINSTALLDIR)
  362. find $(DOCINSTALLDIR) -name 'CVS' -or -name '*.eps' | xargs -n1 rm -rf
  363. install:
  364. @echo Choose install from:
  365. @echo pdfinstall,htmlinstall,htmldosinstall
  366. @exit
  367. #####################################################################
  368. # Archives
  369. #####################################################################
  370. psdist: $(PS)
  371. tar -cvzf fpcdocps.tar.gz $(PS)
  372. zip docs-ps $(PS)
  373. pdfdist: pdf
  374. zip docs-pdf $(PDF)
  375. dvidist: dvi
  376. zip docs-dvi $(DVI)
  377. txtdist: txt
  378. zip docs-txt $(TXT)
  379. #####################################################################
  380. # Zips of htmls
  381. #####################################################################
  382. DOCPREFIX=doc
  383. BASEDIR=$(shell pwd)
  384. htmltar:
  385. ifndef SKIPINSTALL
  386. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  387. endif
  388. cd $(DOCPREFIX) ; tar cz * > $(BASEDIR)/fpcdoc.tar.gz ; cd $(BASEDIR)
  389. rm -rf $(DOCPREFIX)
  390. htmlzip:
  391. ifndef SKIPINSTALL
  392. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  393. endif
  394. zip -D9rq doc-html $(DOCPREFIX)/*
  395. rm -rf $(DOCPREFIX)
  396. htmzip:
  397. ifndef SKIPINSTALL
  398. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  399. endif
  400. makehtm `find $(DOCPREFIX) -name '*.html'`
  401. zip -D9rq doc-htm `find $(DOCPREFIX) -name '*.htm' -or -name '*.gif' -or -name '*.png' -or -name '*.css'`
  402. rm -rf $(DOCPREFIX)
  403. htmldist: htmlzip htmltar
  404. htmdist: htmzip
  405. alldist: dvidist psdist txtdist pdfdist
  406. $(MAKE) htmltar
  407. $(MAKE) htmlzip SKIPINSTALL=Y
  408. $(MAKE) htmzip SKIPINSTALL=Y
  409. distclean: clean
  410. -rm -f *.tar.gz *.zip
  411. #####################################################################
  412. # Examples
  413. #####################################################################
  414. examples:
  415. $(MAKE) -C crtex
  416. $(MAKE) -C dosex
  417. $(MAKE) -C optex
  418. $(MAKE) -C mathex
  419. $(MAKE) -C printex
  420. $(MAKE) -C refex
  421. $(MAKE) -C stringex
  422. $(MAKE) -C objectex
  423. $(MAKE) -C sysutex
  424. $(MAKE) -C typinfex
  425. $(MAKE) -C kbdex
  426. dosexamples: examples
  427. $(MAKE) -C go32ex
  428. $(MAKE) -C mouseex
  429. linuxexamples: examples
  430. $(MAKE) -C linuxex
  431. $(MAKE) -C sockex
  432. $(MAKE) -C ipcex
  433. execute:
  434. $(MAKE) -C dosex all
  435. $(MAKE) -C dosex execute
  436. $(MAKE) -C refex all
  437. $(MAKE) -C refex execute
  438. $(MAKE) -C mathex all
  439. $(MAKE) -C mathex execute
  440. $(MAKE) -C stringex all
  441. $(MAKE) -C stringex execute
  442. $(MAKE) -C objectex all
  443. $(MAKE) -C objectex execute
  444. $(MAKE) -C sysutex all
  445. $(MAKE) -C sysutex execute
  446. $(MAKE) -C typinfex all
  447. $(MAKE) -C typinfex execute
  448. #
  449. # $Log$
  450. # Revision 1.26 2004-05-18 22:10:56 michael
  451. # + Updates for 1.9.4. Mostly MACPas related
  452. #
  453. # Revision 1.25 2004/03/19 17:39:03 peter
  454. # * use fpdoc from utils tree if found
  455. #
  456. # Revision 1.24 2003/11/16 00:03:03 michael
  457. # + Many changes for 2.0 beta
  458. #
  459. # Revision 1.23 2003/11/02 00:14:23 marco
  460. # * fixed classes moving to rtl, and the OS dependancy of the classes unit
  461. # generation.
  462. #
  463. # Revision 1.22 2003/05/29 10:25:51 peter
  464. # * allow to specify FPCSRCDIR and FPDOC
  465. #
  466. # Revision 1.21 2003/03/18 21:25:23 michael
  467. # + Added fcl docs and fpdoc
  468. #
  469. # Revision 1.20 2003/03/18 00:14:51 michael
  470. # + Added fpdoc
  471. #
  472. # Revision 1.19 2003/03/17 08:27:27 michael
  473. # + Split out html generation
  474. #
  475. # Revision 1.18 2003/03/16 15:24:58 peter
  476. # * also remove htex.sed
  477. #
  478. # Revision 1.17 2003/03/16 15:22:18 peter
  479. # * support for hevea
  480. # * provided local copies or required styles since debian does not
  481. # supply the listings.sty anymore
  482. #
  483. # Revision 1.16 2003/02/24 23:37:52 michael
  484. # + Preparations for version 1.0.8
  485. #
  486. # Revision 1.15 2002/11/10 12:22:10 carl
  487. # * update makefiles for testing
  488. # * update example which did not compile
  489. #
  490. # Revision 1.14 2002/04/23 18:03:50 michael
  491. # + removed fcl target in HTML
  492. #
  493. # Revision 1.13 2002/03/19 14:33:18 pierre
  494. # * remove ipcex directory target from examples
  495. #
  496. # Revision 1.12 2002/03/12 22:13:42 michael
  497. # + Now pics directory is included in HTML
  498. #
  499. # Revision 1.11 2001/11/05 20:10:05 michael
  500. # + Added onechap target
  501. #
  502. # Revision 1.10 2001/10/18 21:41:26 peter
  503. # * fixed latex2html settings
  504. #
  505. # Revision 1.9 2001/10/11 23:36:54 carl
  506. # + reinstated Windows NT support
  507. #
  508. # Revision 1.8 2001/10/04 21:03:13 michael
  509. # + Added video and keyboard units
  510. #
  511. # Revision 1.7 2001/09/22 11:15:04 peter
  512. # * chmod the scripts
  513. # * fixed html installation
  514. #
  515. # Revision 1.6 2001/07/29 20:28:00 peter
  516. # * move preamble to separate include file so changes only need to
  517. # be done to this file.
  518. #
  519. # Revision 1.5 2001/07/10 22:01:15 michael
  520. # + Some cleaning up
  521. #
  522. # Revision 1.4 2000/10/12 10:41:58 peter
  523. # * more examples
  524. #
  525. # Revision 1.3 2000/09/02 21:51:36 peter
  526. # * fixed pdf creating (merged)
  527. #
  528. # Revision 1.1 2000/07/13 09:10:03 michael
  529. # + Initial import
  530. #