Makefile 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  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 -image_type gif
  46. endif
  47. # Ascii mode ? (i.e. no pics)
  48. ifndef ASCIIMODE
  49. ASCIIMODE=NO
  50. #ASCIIMODE=YES
  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. # tmpdir
  69. export TMP=/tmp
  70. #
  71. #######################################################################
  72. # End of configurable section. Do not edit after this line.
  73. #######################################################################
  74. PS = $(addsuffix .ps, $(HTML))
  75. DVI = $(addsuffix .dvi, $(HTML))
  76. TXT = $(addsuffix .txt, $(HTML))
  77. PDF = $(addsuffix .pdf, $(HTML))
  78. TOC = $(addsuffix .toc, $(HTML))
  79. AUX = $(addsuffix .aux, $(HTML))
  80. LOG = $(addsuffix .log, $(HTML))
  81. LOT = $(addsuffix .lot, $(HTML))
  82. OUT = $(addsuffix .out, $(HTML))
  83. CHK = $(addsuffix .chk, $(HTML) unitex refex)
  84. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer\
  85. strings objects heaptrc sysutils ipc mouse gpm dxeload \
  86. emu387 ports math)
  87. # Check if ascii-mode requested
  88. ifeq ($(ASCIIMODE),YES)
  89. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  90. endif
  91. #####################################################################
  92. # Conversion from types
  93. #####################################################################
  94. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  95. htm txt pdf refex alldist messages onechap
  96. .SUFFIXES: .dvi .tex .ps .txt .pdf
  97. # default show help
  98. .dvi.ps:
  99. $(DVIPS) $<
  100. .tex.dvi:
  101. $(LATEX) $*
  102. -$(MAKEINDEX) $*
  103. $(LATEX) $*
  104. -$(MAKEINDEX) $*
  105. $(LATEX) $*
  106. .dvi.txt:
  107. $(DVITXT) -o $*.txt $*.dvi
  108. .tex.pdf:
  109. $(PDFLATEX) $*
  110. -$(MAKEINDEX) $*
  111. $(PDFLATEX) $*
  112. -$(MAKEINDEX) $*
  113. $(PDFLATEX) $*
  114. #####################################################################
  115. # Targets
  116. #####################################################################
  117. help:
  118. @echo 'Possible targets :'
  119. @echo ' dvi : Make documentation using latex.'
  120. @echo ' ps : Make documentation using latex and dvips.'
  121. @echo ' html : Make documentation using latex2html.'
  122. @echo ' pdf : Make documentation using pdflatex'
  123. @echo ' txt : dvi, convert to text using dvi2tty'
  124. @echo ' htm : Convert .html to .htm files, zip result'
  125. @echo ' clean : Clean up the mess.'
  126. @echo ' linuxexamples : Compile all examples for linux'
  127. @echo ' dosexamples : Compile all examples for dos'
  128. @echo ' htmldist : html, and rchive result.'
  129. @echo ' psdist : ps, and archive result.'
  130. @echo ' pdfdist : pdf, and archive result.'
  131. clean:
  132. -rm -rf $(HTML) onechap
  133. -rm -f $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) *.i* $(LOT) $(TXT) $(CHK)
  134. -rm -f onechap.dvi onechap.aux onechap.log onechap.chk
  135. # Units
  136. -$(MAKE) -C crtex clean
  137. -$(MAKE) -C dosex clean
  138. -$(MAKE) -C go32ex clean
  139. -$(MAKE) -C heapex clean
  140. -$(MAKE) -C ipcex clean
  141. -$(MAKE) -C linuxex clean
  142. -$(MAKE) -C mouseex clean
  143. -$(MAKE) -C objectex clean
  144. -$(MAKE) -C optex clean
  145. -$(MAKE) -C printex clean
  146. -$(MAKE) -C sockex clean
  147. -$(MAKE) -C stringex clean
  148. -$(MAKE) -C sysutex clean
  149. # Reference
  150. -$(MAKE) -C refex clean
  151. $(TXT) : %.txt: %.dvi
  152. $(DVI) : %.dvi: %.tex
  153. $(PDF) : %.pdf: %.tex
  154. unitex.chk:
  155. ifndef INSTALLDEBUG
  156. $(MAKE) -C crtex tex
  157. $(MAKE) -C dosex tex
  158. $(MAKE) -C go32ex tex
  159. $(MAKE) -C heapex tex
  160. $(MAKE) -C ipcex tex
  161. $(MAKE) -C linuxex tex
  162. $(MAKE) -C mouseex tex
  163. $(MAKE) -C objectex tex
  164. $(MAKE) -C optex tex
  165. $(MAKE) -C printex tex
  166. $(MAKE) -C sockex tex
  167. $(MAKE) -C stringex tex
  168. $(MAKE) -C sysutex tex
  169. endif
  170. touch unitex.chk
  171. refex.chk:
  172. ifndef INSTALLDEBUG
  173. $(MAKE) -C refex tex
  174. endif
  175. touch refex.chk
  176. messages:
  177. msg2inc -TE ../compiler/errore.msg messages.tex
  178. date.inc:
  179. @echo \\date\{`date +'%B %Y'`\} > date.inc
  180. onechap: onechap.dvi
  181. units.dvi: units.tex date.inc $(CHAPTERS)
  182. ref.dvi: ref.tex date.inc
  183. prog.dvi: prog.tex date.inc
  184. user.dvi: user.tex date.inc
  185. units.pdf: units.tex date.inc $(CHAPTERS)
  186. ref.pdf: ref.tex date.inc
  187. user.pdf: user.tex date.inc
  188. prog.pdf: prog.tex date.inc
  189. dvi : $(DVI)
  190. txt : dvi $(TXT)
  191. ps : dvi $(PS)
  192. pdf : $(PDF)
  193. all : dvi ps pdf txt html
  194. #####################################################################
  195. # Html creation
  196. #####################################################################
  197. user: user.chk
  198. user.chk: user.tex date.inc
  199. ifdef INSTALLDEBUG
  200. mkdir user
  201. cp user.tex user/index.html
  202. else
  203. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  204. -t "User's guide for Free Pascal" user.tex
  205. -sed -f foot.sed <user/footnode.html >user/footnote.html
  206. -mv user/footnote.html user/footnode.html
  207. -rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  208. -rm -f user/images.* user/*.log user/WARNINGS
  209. endif
  210. touch user.chk
  211. units: units.chk
  212. units.chk: units.tex unitex.chk date.inc
  213. ifdef INSTALLDEBUG
  214. mkdir units
  215. cp units.tex units/index.html
  216. else
  217. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  218. -t "Unit reference for Free Pascal" units.tex
  219. -sed -f foot.sed <units/footnode.html >units/footnote.html
  220. -mv units/footnote.html units/footnode.html
  221. -rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  222. -rm -f units/images.* units/*.log units/WARNINGS
  223. endif
  224. touch units.chk
  225. ref: ref.chk
  226. ref.chk: refex.chk ref.tex date.inc
  227. ifdef INSTALLDEBUG
  228. mkdir ref
  229. cp ref.tex ref/index.html
  230. else
  231. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  232. -t "Free Pascal reference guide" ref.tex
  233. -sed -f foot.sed <ref/footnode.html >ref/footnote.html
  234. -mv ref/footnote.html ref/footnode.html
  235. -rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  236. -rm -f ref/images.* ref/*.log ref/WARNINGS
  237. endif
  238. touch ref.chk
  239. prog: prog.chk
  240. prog.chk: prog.tex date.inc
  241. ifdef INSTALLDEBUG
  242. mkdir prog
  243. cp prog.tex prog/index.html
  244. else
  245. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  246. -t "Free Pascal programmers guide" prog.tex
  247. -sed -f foot.sed <prog/footnode.html >prog/footnote.html
  248. -mv prog/footnote.html prog/footnode.html
  249. -rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  250. -rm -f prog/images.* prog/*.log prog/WARNINGS
  251. endif
  252. touch prog.chk
  253. internal: internal.chk
  254. internal.chk: internal.tex date.inc
  255. ifdef INSTALLDEBUG
  256. mkdir internal
  257. cp internal.tex internal/index.html
  258. else
  259. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  260. -t "Free Pascal Compiler Documentation" internal.tex
  261. -sed -f foot.sed <internal/footnode.html >internal/footnote.html
  262. -mv internal/footnote.html internal/footnode.html
  263. -rm -f internal/labels.pl internal/internals.pl internal/.*.pag internal/.*.dir
  264. -rm -f internal/images.* internal/*.log internal/WARNINGS
  265. endif
  266. touch internal.chk
  267. onechap: onechap.chk
  268. onechap.chk: onechap.tex date.inc
  269. ifdef INSTALLDEBUG
  270. mkdir onechap
  271. cp onechap.tex onechap/index.html
  272. else
  273. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  274. -t "Free Pascal reference guide" onechap.tex
  275. -sed -f foot.sed <onechap/footnode.html >onechap/footnote.html
  276. -mv onechap/footnote.html onechap/footnode.html
  277. -rm -f onechap/labels.pl onechap/internals.pl onechap/.*.pag onechap/.*.dir
  278. -rm -f onechap/images.* onechap/*.log onechap/WARNINGS
  279. endif
  280. touch onechap.chk
  281. html: $(HTML)
  282. #####################################################################
  283. # Installation
  284. #####################################################################
  285. pdfinstall: pdf
  286. install -d -m 755 $(DOCINSTALLDIR)
  287. cp $(PDF) $(DOCINSTALLDIR)
  288. htmlinstall: html
  289. install -d -m 755 $(DOCINSTALLDIR)
  290. cp fpctoc.html $(DOCINSTALLDIR)
  291. cp -R buttons $(DOCINSTALLDIR)
  292. cp -R search $(DOCINSTALLDIR)
  293. sed s/DOCDIR/"$(subst /,\/,$(DOCINSTALLDIR))"/ $(DOCINSTALLDIR)/search/fpchelp.idksm.linux > $(DOCINSTALLDIR)/search/fpchelp.idksm
  294. cp -f $(DOCINSTALLDIR)/search/filelist.txt.linux $(DOCINSTALLDIR)/search/filelist.txt
  295. rm -f $(DOCINSTALLDIR)/search/*.linux
  296. cp -R $(HTML) $(DOCINSTALLDIR)
  297. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  298. doshtmlinstall: html
  299. install -d -m 755 $(DOCINSTALLDIR)
  300. cp fpctoc.html $(DOCINSTALLDIR)
  301. cp -R buttons $(DOCINSTALLDIR)
  302. cp -R search $(DOCINSTALLDIR)
  303. rm -f $(DOCINSTALLDIR)/search/*.linux
  304. cp -R $(HTML) $(DOCINSTALLDIR)
  305. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  306. www-install: psdist htmlinstall
  307. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  308. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  309. install:
  310. @echo Choose install from:
  311. @echo pdfinstall,htmlinstall,htmldosinstall
  312. @exit
  313. #####################################################################
  314. # Archives
  315. #####################################################################
  316. psdist: $(PS)
  317. tar -cvzf fpcdocps.tar.gz $(PS)
  318. zip docs-ps $(PS)
  319. pdfdist: pdf
  320. zip docs-pdf $(PDF)
  321. dvidist: dvi
  322. zip docs-dvi $(DVI)
  323. txtdist: txt
  324. zip docs-txt $(TXT)
  325. #####################################################################
  326. # Zips of htmls
  327. #####################################################################
  328. DOCPREFIX=doc
  329. BASEDIR=$(shell pwd)
  330. htmltar:
  331. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  332. cd $(DOCPREFIX) ; tar cz * > $(BASEDIR)/fpcdoc.tar.gz ; cd $(BASEDIR)
  333. rm -rf $(DOCPREFIX)
  334. htmlzip:
  335. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  336. zip -D9rq doc-html $(DOCPREFIX)/*
  337. rm -rf $(DOCPREFIX)
  338. htmzip:
  339. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  340. makehtm `find $(DOCPREFIX) -name '*.html'`
  341. zip -D9rq doc-htm `find $(DOCPREFIX) -name '*.htm' -or -name '*.gif' -or -name '*.css'`
  342. rm -rf $(DOCPREFIX)
  343. htmldist: htmlzip htmltar
  344. htmdist: htmzip
  345. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  346. distclean: clean
  347. -rm -f *.tar.gz *.zip
  348. #####################################################################
  349. # Examples
  350. #####################################################################
  351. examples:
  352. $(MAKE) -C crtex
  353. $(MAKE) -C dosex
  354. $(MAKE) -C optex
  355. $(MAKE) -C printex
  356. $(MAKE) -C refex
  357. $(MAKE) -C stringex
  358. $(MAKE) -C ipcex
  359. $(MAKE) -C objectex
  360. $(MAKE) -C sysutex
  361. dosexamples: examples
  362. $(MAKE) -C go32ex
  363. $(MAKE) -C mouseex
  364. linuxexamples: examples
  365. $(MAKE) -C linuxex
  366. $(MAKE) -C sockex
  367. $(MAKE) -C ipcex
  368. #
  369. # $Log$
  370. # Revision 1.1 2000-07-13 09:10:03 michael
  371. # + Initial import
  372. #
  373. # Revision 1.40 2000/07/11 18:07:26 peter
  374. # * fixes for latex2html 0.99b2
  375. #
  376. # Revision 1.39 2000/07/09 15:44:15 peter
  377. # * image_type gif added
  378. #
  379. # Revision 1.38 2000/07/04 21:23:04 michael
  380. # + Added math unit
  381. #
  382. # Revision 1.37 2000/07/04 19:55:48 michael
  383. # + Added ports unit
  384. #
  385. # Revision 1.36 2000/06/14 19:38:43 michael
  386. # + Added gpm units, and corrected L2H options
  387. #
  388. # Revision 1.35 2000/02/20 16:27:38 peter
  389. # * htmlinstall fixes
  390. #
  391. # Revision 1.33 2000/01/23 20:15:16 peter
  392. # * rpm/deb target in install dir
  393. # * install also faq,readme,news for rpm/deb
  394. #
  395. # Revision 1.32 2000/01/14 12:16:40 peter
  396. # * package generation fixes
  397. #
  398. # Revision 1.31 2000/01/11 09:55:36 peter
  399. # * docinstalldir is now calculated by asking ppc386 -iV
  400. #
  401. # Revision 1.30 1999/07/29 21:03:41 peter
  402. # * html 3.2, because 3.1 is buggy !!
  403. #
  404. # Revision 1.29 1999/07/16 10:15:31 peter
  405. # * install targets renamed
  406. #
  407. # Revision 1.28 1999/06/25 22:12:10 michael
  408. # + Update to version 0.19 of listings package
  409. #
  410. # Revision 1.27 1999/06/15 13:53:16 peter
  411. # * htmlzip,htmzip,htmltar updates
  412. # * include search/ in distro
  413. # * fix paths under linux automaticly
  414. #
  415. # Revision 1.26 1999/06/08 22:11:28 peter
  416. # * debian updates
  417. #
  418. # Revision 1.25 1999/06/08 18:28:13 peter
  419. # * fixes for 0.99.12 release
  420. #
  421. # Revision 1.24 1999/06/03 00:06:42 peter
  422. # * html creation works again
  423. #
  424. # Revision 1.23 1999/06/02 17:41:33 peter
  425. # * fixes for html creation
  426. #
  427. # Revision 1.22 1999/05/31 16:37:08 peter
  428. # * fixes for html creation
  429. #
  430. # Revision 1.21 1999/05/28 19:59:37 michael
  431. # Additional changes
  432. #
  433. # Revision 1.20 1999/04/10 14:57:43 michael
  434. # + Added sysutils
  435. #
  436. # Revision 1.19 1999/02/12 14:15:00 michael
  437. # * Last-minute changes so it can be texed
  438. #
  439. # Revision 1.18 1999/02/02 22:47:04 michael
  440. # + Better clean
  441. #
  442. # Revision 1.17 1999/01/17 15:12:50 michael
  443. # Added examples 27-40
  444. #
  445. # Revision 1.16 1998/12/15 23:50:53 michael
  446. # * Some updates
  447. #
  448. # Revision 1.15 1998/11/17 23:42:02 michael
  449. # + too many changes to enumerate
  450. #
  451. # Revision 1.14 1998/10/01 12:57:22 michael
  452. # + Correction in dependencies
  453. #
  454. # Revision 1.13 1998/09/13 19:26:13 michael
  455. # + Added messages target
  456. #
  457. # Revision 1.12 1998/09/13 12:42:05 michael
  458. # Added error messages and used listings package for program examples
  459. #
  460. # Revision 1.11 1998/09/11 12:08:07 michael
  461. # Additional cleans
  462. #
  463. # Revision 1.10 1998/09/11 11:01:10 peter
  464. # * export a TMP=/tmp for dvips which don't like '.' in the directory
  465. #
  466. #