Makefile 13 KB

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