Makefile 12 KB

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