Makefile 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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
  23. # Can be 'report','book' or 'html'
  24. PREAMBLETYPE = report
  25. # Where do you want the html files to be put ?
  26. ifndef PREFIXINSTALLDIR
  27. PREFIXINSTALLDIR=/usr
  28. endif
  29. ifndef DOCINSTALLDIR
  30. DOCINSTALLDIR:=$(PREFIXINSTALLDIR)/doc/fpc-$(shell ppc386 -iV)
  31. endif
  32. #
  33. # Program definitions
  34. #
  35. # Latex
  36. ifndef LATEX
  37. LATEX = latex
  38. endif
  39. # Latex2html conversion.
  40. ifndef LATEX2HTML
  41. LATEX2HTML = /usr/bin/latex2html
  42. endif
  43. # Options for converter
  44. ifndef LATEX2HTMLOPTS
  45. LATEX2HTMLOPTS = -no_reuse -up_url "../fpctoc.html"\
  46. -up_title "Free Pascal manuals"\
  47. -html_version 4.0 -split 3
  48. endif
  49. # Ascii mode ? (i.e. no pics)
  50. ifndef ASCIIMODE
  51. ASCIIMODE=NO
  52. #ASCIIMODE=YES
  53. endif
  54. # DVI to PS converter
  55. ifndef DVIPS
  56. DVIPS=dvips
  57. endif
  58. # DVI to TXT converter
  59. ifndef DVITXT
  60. DVITXT=dvi2tty -w132
  61. endif
  62. # PDF converter
  63. ifndef PDFLATEX
  64. PDFLATEX=pdflatex
  65. endif
  66. # Makeindex programma
  67. ifndef MAKEINDEX
  68. MAKEINDEX=makeindex
  69. endif
  70. # tmpdir
  71. export TMP=/tmp
  72. #
  73. #######################################################################
  74. # End of configurable section. Do not edit after this line.
  75. #######################################################################
  76. PS = $(addsuffix .ps, $(HTML))
  77. DVI = $(addsuffix .dvi, $(HTML))
  78. TXT = $(addsuffix .txt, $(HTML))
  79. PDF = $(addsuffix .pdf, $(HTML))
  80. TOC = $(addsuffix .toc, $(HTML) onechap)
  81. AUX = $(addsuffix .aux, $(HTML) onechap)
  82. LOG = $(addsuffix .log, $(HTML) onechap)
  83. LOT = $(addsuffix .lot, $(HTML) onechap)
  84. OUT = $(addsuffix .out, $(HTML) onechap)
  85. CHK = $(addsuffix .chk, $(HTML) progex unitex refex htex onechap scripts)
  86. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer\
  87. strings objects heaptrc sysutils ipc mouse gpm dxeload \
  88. emu387 ports math keyboard typinfo video)
  89. GTKPDF=$(addsuffix .pdf,$(addprefix gtk, 1 2 3 4 5))
  90. # Check if ascii-mode requested
  91. ifeq ($(ASCIIMODE),YES)
  92. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  93. endif
  94. #####################################################################
  95. # Conversion from types
  96. #####################################################################
  97. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  98. htm txt pdf refex alldist messages onechap gtk
  99. .SUFFIXES: .dvi .tex .ps .txt .pdf
  100. # default show help
  101. .dvi.ps:
  102. $(DVIPS) $<
  103. .tex.dvi:
  104. $(LATEX) $*
  105. -$(MAKEINDEX) $*
  106. $(LATEX) $*
  107. -$(MAKEINDEX) $*
  108. $(LATEX) $*
  109. .dvi.txt:
  110. $(DVITXT) -o $*.txt $*.dvi
  111. .tex.pdf:
  112. $(PDFLATEX) $*
  113. -$(MAKEINDEX) $*
  114. $(PDFLATEX) $*
  115. -$(MAKEINDEX) $*
  116. $(PDFLATEX) $*
  117. #####################################################################
  118. # Targets
  119. #####################################################################
  120. help:
  121. @echo 'Possible targets :'
  122. @echo ' dvi : Make documentation using latex.'
  123. @echo ' ps : Make documentation using latex and dvips.'
  124. @echo ' html : Make documentation using latex2html.'
  125. @echo ' pdf : Make documentation using pdflatex'
  126. @echo ' txt : dvi, convert to text using dvi2tty'
  127. @echo ' htm : Convert .html to .htm files, zip result'
  128. @echo ' clean : Clean up the mess.'
  129. @echo ' linuxexamples : Compile all examples for linux'
  130. @echo ' dosexamples : Compile all examples for dos'
  131. @echo ' htmldist : html, and rchive result.'
  132. @echo ' psdist : ps, and archive result.'
  133. @echo ' pdfdist : pdf, and archive result.'
  134. clean:
  135. -rm -f preamble.inc date.inc
  136. -rm -f *.htex
  137. -rm -rf $(HTML) onechap
  138. -rm -f $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) *.i* $(LOT) $(TXT) $(CHK)
  139. # Units
  140. -$(MAKE) -C crtex clean
  141. -$(MAKE) -C dosex clean
  142. -$(MAKE) -C go32ex clean
  143. -$(MAKE) -C heapex clean
  144. -$(MAKE) -C ipcex clean
  145. -$(MAKE) -C linuxex clean
  146. -$(MAKE) -C mouseex clean
  147. -$(MAKE) -C objectex clean
  148. -$(MAKE) -C optex clean
  149. -$(MAKE) -C printex clean
  150. -$(MAKE) -C sockex clean
  151. -$(MAKE) -C stringex clean
  152. -$(MAKE) -C sysutex clean
  153. -$(MAKE) -C mathex clean
  154. -$(MAKE) -C graphex clean
  155. -$(MAKE) -C gpmex clean
  156. -$(MAKE) -C typinfex clean
  157. -$(MAKE) -C kbdex clean
  158. # Reference
  159. -$(MAKE) -C refex clean
  160. # Programmers manual
  161. -$(MAKE) -C progex clean
  162. $(TXT) : %.txt: %.dvi
  163. $(DVI) : %.dvi: %.tex
  164. $(PDF) : %.pdf: %.tex
  165. unitex.chk:
  166. ifndef INSTALLDEBUG
  167. $(MAKE) -C crtex tex
  168. $(MAKE) -C dosex tex
  169. $(MAKE) -C go32ex tex
  170. $(MAKE) -C heapex tex
  171. $(MAKE) -C ipcex tex
  172. $(MAKE) -C linuxex tex
  173. $(MAKE) -C mouseex tex
  174. $(MAKE) -C objectex tex
  175. $(MAKE) -C optex tex
  176. $(MAKE) -C printex tex
  177. $(MAKE) -C sockex tex
  178. $(MAKE) -C stringex tex
  179. $(MAKE) -C sysutex tex
  180. $(MAKE) -C mathex tex
  181. $(MAKE) -C graphex tex
  182. $(MAKE) -C gpmex tex
  183. $(MAKE) -C kbdex tex
  184. $(MAKE) -C typinfex tex
  185. endif
  186. touch unitex.chk
  187. refex.chk:
  188. ifndef INSTALLDEBUG
  189. $(MAKE) -C refex tex
  190. endif
  191. touch refex.chk
  192. progex.chk:
  193. ifndef INSTALLDEBUG
  194. $(MAKE) -C progex tex
  195. endif
  196. touch progex.chk
  197. messages:
  198. msg2inc -TE ../compiler/errore.msg messages.tex
  199. #
  200. # Include files
  201. #
  202. date.inc:
  203. @echo \\date\{`date +'%B %Y'`\} > date.inc
  204. preamble.inc:
  205. cp -f preamble.$(PREAMBLETYPE) preamble.inc
  206. ifeq ($(OS),Windows_NT)
  207. inWinNT=1
  208. endif
  209. ifndef inWinNT
  210. scripts.chk:
  211. chmod +x tex2htex
  212. chmod +x pp2tex
  213. chmod +x progex/c2tex
  214. touch scripts.chk
  215. endif
  216. ifndef inWinNT
  217. includes: date.inc preamble.inc scripts.chk
  218. else
  219. includes: date.inc preamble.inc
  220. endif
  221. #
  222. # DVI files
  223. #
  224. onechap: onechap.dvi
  225. units.dvi: units.tex includes $(CHAPTERS)
  226. ref.dvi: ref.tex includes
  227. prog.dvi: prog.tex includes
  228. user.dvi: user.tex includes
  229. units.pdf: units.tex includes $(CHAPTERS)
  230. ref.pdf: ref.tex includes
  231. user.pdf: user.tex includes
  232. prog.pdf: prog.tex includes
  233. dvi : $(DVI)
  234. txt : dvi $(TXT)
  235. ps : dvi $(PS)
  236. pdf : $(PDF)
  237. all : dvi ps pdf txt html
  238. #####################################################################
  239. # Html creation
  240. #####################################################################
  241. htex: htex.chk
  242. htex.chk: $(wildcard *.tex) includes
  243. ./tex2htex
  244. touch htex.chk
  245. user: user.chk
  246. user.chk: htex.chk includes
  247. ifdef INSTALLDEBUG
  248. mkdir user
  249. cp user.tex user/index.html
  250. else
  251. cp -f preamble.html preamble.inc
  252. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  253. -t "User's guide for Free Pascal" user.htex
  254. -sed -f foot.sed <user/footnode.html >user/footnote.html
  255. -mv user/footnote.html user/footnode.html
  256. -rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  257. -rm -f user/images.* user/*.log user/WARNINGS
  258. endif
  259. touch user.chk
  260. units: units.chk
  261. units.chk: unitex.chk htex.chk includes
  262. ifdef INSTALLDEBUG
  263. mkdir units
  264. cp units.tex units/index.html
  265. else
  266. cp -f preamble.html preamble.inc
  267. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  268. -t "Unit reference for Free Pascal" units.htex
  269. -sed -f foot.sed <units/footnode.html >units/footnote.html
  270. -mv units/footnote.html units/footnode.html
  271. ifndef DEBUG
  272. -rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  273. -rm -f units/images.* units/*.log units/WARNINGS
  274. endif
  275. endif
  276. touch units.chk
  277. ref: ref.chk
  278. ref.chk: refex.chk htex.chk includes
  279. ifdef INSTALLDEBUG
  280. mkdir ref
  281. cp ref.tex ref/index.html
  282. else
  283. cp -f preamble.html preamble.inc
  284. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  285. -t "Free Pascal reference guide" ref.htex
  286. -sed -f foot.sed <ref/footnode.html >ref/footnote.html
  287. -mv ref/footnote.html ref/footnode.html
  288. ifndef DEBUG
  289. -rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  290. -rm -f ref/images.* ref/*.log ref/WARNINGS
  291. endif
  292. endif
  293. touch ref.chk
  294. prog: prog.chk
  295. prog.chk: progex.chk htex.chk includes
  296. ifdef INSTALLDEBUG
  297. mkdir prog
  298. cp prog.tex prog/index.html
  299. else
  300. cp -f preamble.html preamble.inc
  301. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  302. -t "Free Pascal programmers guide" prog.htex
  303. -sed -f foot.sed <prog/footnode.html >prog/footnote.html
  304. -mv prog/footnote.html prog/footnode.html
  305. ifndef DEBUG
  306. -rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  307. -rm -f prog/images.* prog/*.log prog/WARNINGS
  308. endif
  309. endif
  310. touch prog.chk
  311. internal: internal.chk
  312. internal.chk: htex.chk
  313. ifdef INSTALLDEBUG
  314. mkdir internal
  315. cp internal.tex internal/index.html
  316. else
  317. cp -f preamble.html preamble.inc
  318. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  319. -t "Free Pascal Compiler Documentation" internal.htex
  320. -sed -f foot.sed <internal/footnode.html >internal/footnote.html
  321. -mv internal/footnote.html internal/footnode.html
  322. ifndef DEBUG
  323. -rm -f internal/labels.pl internal/internals.pl internal/.*.pag internal/.*.dir
  324. -rm -f internal/images.* internal/*.log internal/WARNINGS
  325. endif
  326. endif
  327. touch internal.chk
  328. onechap: onechap.chk
  329. onechap.chk: unitex.chk htex.chk includes
  330. ifdef INSTALLDEBUG
  331. mkdir onechap
  332. cp onechap.tex onechap/index.html
  333. else
  334. cp -f preamble.html preamble.inc
  335. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  336. -t "Free Pascal reference guide" onechap.htex
  337. -sed -f foot.sed <onechap/footnode.html >onechap/footnote.html
  338. -mv onechap/footnote.html onechap/footnode.html
  339. ifndef DEBUG
  340. -rm -f onechap/labels.pl onechap/internals.pl onechap/.*.pag onechap/.*.dir
  341. -rm -f onechap/images.* onechap/*.log onechap/WARNINGS
  342. endif
  343. endif
  344. touch onechap.chk
  345. html: $(HTML)
  346. #####################################################################
  347. # GTK Articles
  348. #####################################################################
  349. gtk: $(GTKPDF)
  350. gtk1.pdf: gtk1.tex
  351. gtk2.pdf: gtk2.tex
  352. gtk3.pdf: gtk3.tex
  353. gtk4.pdf: gtk4.tex
  354. gtk5.pdf: gtk5.tex
  355. #####################################################################
  356. # Installation
  357. #####################################################################
  358. pdfinstall: pdf
  359. install -d -m 755 $(DOCINSTALLDIR)
  360. cp $(PDF) $(DOCINSTALLDIR)
  361. htmlinstall: html
  362. install -d -m 755 $(DOCINSTALLDIR)
  363. cp fpctoc.html $(DOCINSTALLDIR)
  364. cp -R buttons $(DOCINSTALLDIR)
  365. cp -R $(HTML) $(DOCINSTALLDIR)
  366. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  367. install:
  368. @echo Choose install from:
  369. @echo pdfinstall,htmlinstall,htmldosinstall
  370. @exit
  371. #####################################################################
  372. # Archives
  373. #####################################################################
  374. psdist: $(PS)
  375. tar -cvzf fpcdocps.tar.gz $(PS)
  376. zip docs-ps $(PS)
  377. pdfdist: pdf
  378. zip docs-pdf $(PDF)
  379. dvidist: dvi
  380. zip docs-dvi $(DVI)
  381. txtdist: txt
  382. zip docs-txt $(TXT)
  383. #####################################################################
  384. # Zips of htmls
  385. #####################################################################
  386. DOCPREFIX=doc
  387. BASEDIR=$(shell pwd)
  388. htmltar:
  389. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  390. cd $(DOCPREFIX) ; tar cz * > $(BASEDIR)/fpcdoc.tar.gz ; cd $(BASEDIR)
  391. rm -rf $(DOCPREFIX)
  392. htmlzip:
  393. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  394. zip -D9rq doc-html $(DOCPREFIX)/*
  395. rm -rf $(DOCPREFIX)
  396. htmzip:
  397. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  398. makehtm `find $(DOCPREFIX) -name '*.html'`
  399. zip -D9rq doc-htm `find $(DOCPREFIX) -name '*.htm' -or -name '*.gif' -or -name '*.css'`
  400. rm -rf $(DOCPREFIX)
  401. htmldist: htmlzip htmltar
  402. htmdist: htmzip
  403. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  404. distclean: clean
  405. -rm -f *.tar.gz *.zip
  406. #####################################################################
  407. # Examples
  408. #####################################################################
  409. examples:
  410. $(MAKE) -C crtex
  411. $(MAKE) -C dosex
  412. $(MAKE) -C optex
  413. $(MAKE) -C printex
  414. $(MAKE) -C refex
  415. $(MAKE) -C stringex
  416. $(MAKE) -C ipcex
  417. $(MAKE) -C objectex
  418. $(MAKE) -C sysutex
  419. $(MAKE) -C typinfex
  420. $(MAKE) -C kbdex
  421. dosexamples: examples
  422. $(MAKE) -C go32ex
  423. $(MAKE) -C mouseex
  424. linuxexamples: examples
  425. $(MAKE) -C linuxex
  426. $(MAKE) -C sockex
  427. $(MAKE) -C ipcex
  428. #
  429. # $Log$
  430. # Revision 1.10 2001-10-18 21:41:26 peter
  431. # * fixed latex2html settings
  432. #
  433. # Revision 1.9 2001/10/11 23:36:54 carl
  434. # + reinstated Windows NT support
  435. #
  436. # Revision 1.8 2001/10/04 21:03:13 michael
  437. # + Added video and keyboard units
  438. #
  439. # Revision 1.7 2001/09/22 11:15:04 peter
  440. # * chmod the scripts
  441. # * fixed html installation
  442. #
  443. # Revision 1.6 2001/07/29 20:28:00 peter
  444. # * move preamble to separate include file so changes only need to
  445. # be done to this file.
  446. #
  447. # Revision 1.5 2001/07/10 22:01:15 michael
  448. # + Some cleaning up
  449. #
  450. # Revision 1.4 2000/10/12 10:41:58 peter
  451. # * more examples
  452. #
  453. # Revision 1.3 2000/09/02 21:51:36 peter
  454. # * fixed pdf creating (merged)
  455. #
  456. # Revision 1.1 2000/07/13 09:10:03 michael
  457. # + Initial import
  458. #