Makefile 14 KB

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