2
0

Makefile 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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. # 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)
  133. -rm -f $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) *.i* $(LOT) $(TXT) $(CHK)
  134. -rm -f onechap.dvi onechap.aux onechap.log
  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. html: $(HTML)
  268. #####################################################################
  269. # Installation
  270. #####################################################################
  271. pdfinstall: pdf
  272. install -d -m 755 $(DOCINSTALLDIR)
  273. cp $(PDF) $(DOCINSTALLDIR)
  274. htmlinstall: html
  275. install -d -m 755 $(DOCINSTALLDIR)
  276. cp fpctoc.html $(DOCINSTALLDIR)
  277. cp -R buttons $(DOCINSTALLDIR)
  278. cp -R search $(DOCINSTALLDIR)
  279. sed s/DOCDIR/"$(subst /,\/,$(DOCINSTALLDIR))"/ $(DOCINSTALLDIR)/search/fpchelp.idksm.linux > $(DOCINSTALLDIR)/search/fpchelp.idksm
  280. cp -f $(DOCINSTALLDIR)/search/filelist.txt.linux $(DOCINSTALLDIR)/search/filelist.txt
  281. rm -f $(DOCINSTALLDIR)/search/*.linux
  282. cp -R $(HTML) $(DOCINSTALLDIR)
  283. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  284. doshtmlinstall: html
  285. install -d -m 755 $(DOCINSTALLDIR)
  286. cp fpctoc.html $(DOCINSTALLDIR)
  287. cp -R buttons $(DOCINSTALLDIR)
  288. cp -R search $(DOCINSTALLDIR)
  289. rm -f $(DOCINSTALLDIR)/search/*.linux
  290. cp -R $(HTML) $(DOCINSTALLDIR)
  291. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  292. www-install: psdist htmlinstall
  293. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  294. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  295. install:
  296. @echo Choose install from:
  297. @echo pdfinstall,htmlinstall,htmldosinstall
  298. @exit
  299. #####################################################################
  300. # Archives
  301. #####################################################################
  302. psdist: $(PS)
  303. tar -cvzf fpcdocps.tar.gz $(PS)
  304. zip docs-ps $(PS)
  305. pdfdist: pdf
  306. zip docs-pdf $(PDF)
  307. dvidist: dvi
  308. zip docs-dvi $(DVI)
  309. txtdist: txt
  310. zip docs-txt $(TXT)
  311. #####################################################################
  312. # Zips of htmls
  313. #####################################################################
  314. DOCPREFIX=doc
  315. BASEDIR=$(shell pwd)
  316. htmltar:
  317. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  318. cd $(DOCPREFIX) ; tar cz * > $(BASEDIR)/fpcdoc.tar.gz ; cd $(BASEDIR)
  319. rm -rf $(DOCPREFIX)
  320. htmlzip:
  321. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  322. zip -D9rq doc-html $(DOCPREFIX)/*
  323. rm -rf $(DOCPREFIX)
  324. htmzip:
  325. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  326. makehtm `find $(DOCPREFIX) -name '*.html'`
  327. zip -D9rq doc-htm `find $(DOCPREFIX) -name '*.htm' -or -name '*.gif' -or -name '*.css'`
  328. rm -rf $(DOCPREFIX)
  329. htmldist: htmlzip htmltar
  330. htmdist: htmzip
  331. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  332. distclean: clean
  333. -rm -f *.tar.gz *.zip
  334. #####################################################################
  335. # Examples
  336. #####################################################################
  337. examples:
  338. $(MAKE) -C crtex
  339. $(MAKE) -C dosex
  340. $(MAKE) -C optex
  341. $(MAKE) -C printex
  342. $(MAKE) -C refex
  343. $(MAKE) -C stringex
  344. $(MAKE) -C ipcex
  345. $(MAKE) -C objectex
  346. $(MAKE) -C sysutex
  347. dosexamples: examples
  348. $(MAKE) -C go32ex
  349. $(MAKE) -C mouseex
  350. linuxexamples: examples
  351. $(MAKE) -C linuxex
  352. $(MAKE) -C sockex
  353. $(MAKE) -C ipcex
  354. #
  355. # $Log$
  356. # Revision 1.38 2000-07-04 21:23:04 michael
  357. # + Added math unit
  358. #
  359. # Revision 1.37 2000/07/04 19:55:48 michael
  360. # + Added ports unit
  361. #
  362. # Revision 1.36 2000/06/14 19:38:43 michael
  363. # + Added gpm units, and corrected L2H options
  364. #
  365. # Revision 1.35 2000/02/20 16:27:38 peter
  366. # * htmlinstall fixes
  367. #
  368. # Revision 1.33 2000/01/23 20:15:16 peter
  369. # * rpm/deb target in install dir
  370. # * install also faq,readme,news for rpm/deb
  371. #
  372. # Revision 1.32 2000/01/14 12:16:40 peter
  373. # * package generation fixes
  374. #
  375. # Revision 1.31 2000/01/11 09:55:36 peter
  376. # * docinstalldir is now calculated by asking ppc386 -iV
  377. #
  378. # Revision 1.30 1999/07/29 21:03:41 peter
  379. # * html 3.2, because 3.1 is buggy !!
  380. #
  381. # Revision 1.29 1999/07/16 10:15:31 peter
  382. # * install targets renamed
  383. #
  384. # Revision 1.28 1999/06/25 22:12:10 michael
  385. # + Update to version 0.19 of listings package
  386. #
  387. # Revision 1.27 1999/06/15 13:53:16 peter
  388. # * htmlzip,htmzip,htmltar updates
  389. # * include search/ in distro
  390. # * fix paths under linux automaticly
  391. #
  392. # Revision 1.26 1999/06/08 22:11:28 peter
  393. # * debian updates
  394. #
  395. # Revision 1.25 1999/06/08 18:28:13 peter
  396. # * fixes for 0.99.12 release
  397. #
  398. # Revision 1.24 1999/06/03 00:06:42 peter
  399. # * html creation works again
  400. #
  401. # Revision 1.23 1999/06/02 17:41:33 peter
  402. # * fixes for html creation
  403. #
  404. # Revision 1.22 1999/05/31 16:37:08 peter
  405. # * fixes for html creation
  406. #
  407. # Revision 1.21 1999/05/28 19:59:37 michael
  408. # Additional changes
  409. #
  410. # Revision 1.20 1999/04/10 14:57:43 michael
  411. # + Added sysutils
  412. #
  413. # Revision 1.19 1999/02/12 14:15:00 michael
  414. # * Last-minute changes so it can be texed
  415. #
  416. # Revision 1.18 1999/02/02 22:47:04 michael
  417. # + Better clean
  418. #
  419. # Revision 1.17 1999/01/17 15:12:50 michael
  420. # Added examples 27-40
  421. #
  422. # Revision 1.16 1998/12/15 23:50:53 michael
  423. # * Some updates
  424. #
  425. # Revision 1.15 1998/11/17 23:42:02 michael
  426. # + too many changes to enumerate
  427. #
  428. # Revision 1.14 1998/10/01 12:57:22 michael
  429. # + Correction in dependencies
  430. #
  431. # Revision 1.13 1998/09/13 19:26:13 michael
  432. # + Added messages target
  433. #
  434. # Revision 1.12 1998/09/13 12:42:05 michael
  435. # Added error messages and used listings package for program examples
  436. #
  437. # Revision 1.11 1998/09/11 12:08:07 michael
  438. # Additional cleans
  439. #
  440. # Revision 1.10 1998/09/11 11:01:10 peter
  441. # * export a TMP=/tmp for dvips which don't like '.' in the directory
  442. #
  443. #