Makefile 14 KB

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