Makefile 12 KB

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