Makefile 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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. # 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. # Check if ascii-mode requested
  91. ifeq ($(ASCIIMODE),YES)
  92. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  93. endif
  94. #####################################################################
  95. # Conversion from types
  96. #####################################################################
  97. .PHONY: clean dvi help html ps psdist htmldist pdfdist txtdist \
  98. htm txt pdf refex alldist messages onechap
  99. .SUFFIXES: .dvi .tex .ps .txt .pdf
  100. # default show help
  101. .dvi.ps:
  102. $(DVIPS) $<
  103. .tex.dvi:
  104. $(LATEX) $*
  105. -$(MAKEINDEX) $*
  106. $(LATEX) $*
  107. -$(MAKEINDEX) $*
  108. $(LATEX) $*
  109. .dvi.txt:
  110. $(DVITXT) -o $*.txt $*.dvi
  111. .tex.pdf:
  112. $(PDFLATEX) $*
  113. -$(MAKEINDEX) $*
  114. $(PDFLATEX) $*
  115. -$(MAKEINDEX) $*
  116. $(PDFLATEX) $*
  117. #####################################################################
  118. # Targets
  119. #####################################################################
  120. help:
  121. @echo 'Possible targets :'
  122. @echo ' dvi : Make documentation using latex.'
  123. @echo ' ps : Make documentation using latex and dvips.'
  124. @echo ' html : Make documentation using latex2html.'
  125. @echo ' pdf : Make documentation using pdflatex'
  126. @echo ' txt : dvi, convert to text using dvi2tty'
  127. @echo ' htm : Convert .html to .htm files, zip result'
  128. @echo ' clean : Clean up the mess.'
  129. @echo ' linuxexamples : Compile all examples for linux'
  130. @echo ' dosexamples : Compile all examples for dos'
  131. @echo ' htmldist : html, and rchive result.'
  132. @echo ' psdist : ps, and archive result.'
  133. @echo ' pdfdist : pdf, and archive result.'
  134. clean:
  135. -rm -f *.htex
  136. -rm -rf $(HTML) onechap
  137. -rm -f $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) *.i* $(LOT) $(TXT) $(CHK)
  138. # Units
  139. -$(MAKE) -C crtex clean
  140. -$(MAKE) -C dosex clean
  141. -$(MAKE) -C go32ex clean
  142. -$(MAKE) -C heapex clean
  143. -$(MAKE) -C ipcex clean
  144. -$(MAKE) -C linuxex clean
  145. -$(MAKE) -C mouseex clean
  146. -$(MAKE) -C objectex clean
  147. -$(MAKE) -C optex clean
  148. -$(MAKE) -C printex clean
  149. -$(MAKE) -C sockex clean
  150. -$(MAKE) -C stringex clean
  151. -$(MAKE) -C sysutex clean
  152. -$(MAKE) -C mathex clean
  153. -$(MAKE) -C graphex clean
  154. -$(MAKE) -C gpmex clean
  155. # Reference
  156. -$(MAKE) -C refex clean
  157. $(TXT) : %.txt: %.dvi
  158. $(DVI) : %.dvi: %.tex
  159. $(PDF) : %.pdf: %.tex
  160. unitex.chk:
  161. ifndef INSTALLDEBUG
  162. $(MAKE) -C crtex tex
  163. $(MAKE) -C dosex tex
  164. $(MAKE) -C go32ex tex
  165. $(MAKE) -C heapex tex
  166. $(MAKE) -C ipcex tex
  167. $(MAKE) -C linuxex tex
  168. $(MAKE) -C mouseex tex
  169. $(MAKE) -C objectex tex
  170. $(MAKE) -C optex tex
  171. $(MAKE) -C printex tex
  172. $(MAKE) -C sockex tex
  173. $(MAKE) -C stringex tex
  174. $(MAKE) -C sysutex tex
  175. $(MAKE) -C mathex tex
  176. $(MAKE) -C graphex tex
  177. $(MAKE) -C gpmex tex
  178. endif
  179. touch unitex.chk
  180. refex.chk:
  181. ifndef INSTALLDEBUG
  182. $(MAKE) -C refex tex
  183. endif
  184. touch refex.chk
  185. progex.chk:
  186. ifndef INSTALLDEBUG
  187. $(MAKE) -C progex tex
  188. endif
  189. touch progex.chk
  190. messages:
  191. msg2inc -TE ../compiler/errore.msg messages.tex
  192. date.inc:
  193. @echo \\date\{`date +'%B %Y'`\} > date.inc
  194. onechap: onechap.dvi
  195. units.dvi: units.tex date.inc $(CHAPTERS)
  196. ref.dvi: ref.tex date.inc
  197. prog.dvi: prog.tex date.inc
  198. user.dvi: user.tex date.inc
  199. units.pdf: units.tex date.inc $(CHAPTERS)
  200. ref.pdf: ref.tex date.inc
  201. user.pdf: user.tex date.inc
  202. prog.pdf: prog.tex date.inc
  203. dvi : $(DVI)
  204. txt : dvi $(TXT)
  205. ps : dvi $(PS)
  206. pdf : $(PDF)
  207. all : dvi ps pdf txt html
  208. #####################################################################
  209. # Html creation
  210. #####################################################################
  211. htex: htex.chk
  212. htex.chk: $(wildcard *.tex)
  213. ./tex2htex
  214. touch htex.chk
  215. user: user.chk
  216. user.chk: htex.chk date.inc
  217. ifdef INSTALLDEBUG
  218. mkdir user
  219. cp user.tex user/index.html
  220. else
  221. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  222. -t "User's guide for Free Pascal" user.htex
  223. -sed -f foot.sed <user/footnode.html >user/footnote.html
  224. -mv user/footnote.html user/footnode.html
  225. -rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  226. -rm -f user/images.* user/*.log user/WARNINGS
  227. endif
  228. touch user.chk
  229. units: units.chk
  230. units.chk: unitex.chk htex.chk date.inc
  231. ifdef INSTALLDEBUG
  232. mkdir units
  233. cp units.tex units/index.html
  234. else
  235. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  236. -t "Unit reference for Free Pascal" units.htex
  237. -sed -f foot.sed <units/footnode.html >units/footnote.html
  238. -mv units/footnote.html units/footnode.html
  239. ifndef LOG
  240. -rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  241. -rm -f units/images.* units/*.log units/WARNINGS
  242. endif
  243. endif
  244. touch units.chk
  245. ref: ref.chk
  246. ref.chk: refex.chk htex.chk date.inc
  247. ifdef INSTALLDEBUG
  248. mkdir ref
  249. cp ref.tex ref/index.html
  250. else
  251. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  252. -t "Free Pascal reference guide" ref.htex
  253. -sed -f foot.sed <ref/footnode.html >ref/footnote.html
  254. -mv ref/footnote.html ref/footnode.html
  255. ifndef LOG
  256. -rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  257. -rm -f ref/images.* ref/*.log ref/WARNINGS
  258. endif
  259. endif
  260. touch ref.chk
  261. prog: prog.chk
  262. prog.chk: progex.chk htex.chk date.inc
  263. ifdef INSTALLDEBUG
  264. mkdir prog
  265. cp prog.tex prog/index.html
  266. else
  267. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  268. -t "Free Pascal programmers guide" prog.htex
  269. -sed -f foot.sed <prog/footnode.html >prog/footnote.html
  270. -mv prog/footnote.html prog/footnode.html
  271. ifndef LOG
  272. -rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  273. -rm -f prog/images.* prog/*.log prog/WARNINGS
  274. endif
  275. endif
  276. touch prog.chk
  277. internal: internal.chk
  278. internal.chk: htex.chk date.inc
  279. ifdef INSTALLDEBUG
  280. mkdir internal
  281. cp internal.tex internal/index.html
  282. else
  283. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  284. -t "Free Pascal Compiler Documentation" internal.htex
  285. -sed -f foot.sed <internal/footnode.html >internal/footnote.html
  286. -mv internal/footnote.html internal/footnode.html
  287. ifndef LOG
  288. -rm -f internal/labels.pl internal/internals.pl internal/.*.pag internal/.*.dir
  289. -rm -f internal/images.* internal/*.log internal/WARNINGS
  290. endif
  291. endif
  292. touch internal.chk
  293. onechap: onechap.chk
  294. onechap.chk: unitex.chk htex.chk date.inc
  295. ifdef INSTALLDEBUG
  296. mkdir onechap
  297. cp onechap.tex onechap/index.html
  298. else
  299. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 4 -link 2\
  300. -t "Free Pascal reference guide" onechap.htex
  301. -sed -f foot.sed <onechap/footnode.html >onechap/footnote.html
  302. -mv onechap/footnote.html onechap/footnode.html
  303. ifndef LOG
  304. -rm -f onechap/labels.pl onechap/internals.pl onechap/.*.pag onechap/.*.dir
  305. -rm -f onechap/images.* onechap/*.log onechap/WARNINGS
  306. endif
  307. endif
  308. touch onechap.chk
  309. html: $(HTML)
  310. #####################################################################
  311. # Installation
  312. #####################################################################
  313. pdfinstall: pdf
  314. install -d -m 755 $(DOCINSTALLDIR)
  315. cp $(PDF) $(DOCINSTALLDIR)
  316. htmlinstall: html
  317. install -d -m 755 $(DOCINSTALLDIR)
  318. cp fpctoc.html $(DOCINSTALLDIR)
  319. cp -R buttons $(DOCINSTALLDIR)
  320. cp -R search $(DOCINSTALLDIR)
  321. sed s/DOCDIR/"$(subst /,\/,$(DOCINSTALLDIR))"/ $(DOCINSTALLDIR)/search/fpchelp.idksm.linux > $(DOCINSTALLDIR)/search/fpchelp.idksm
  322. cp -f $(DOCINSTALLDIR)/search/filelist.txt.linux $(DOCINSTALLDIR)/search/filelist.txt
  323. rm -f $(DOCINSTALLDIR)/search/*.linux
  324. cp -R $(HTML) $(DOCINSTALLDIR)
  325. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  326. doshtmlinstall: html
  327. install -d -m 755 $(DOCINSTALLDIR)
  328. cp fpctoc.html $(DOCINSTALLDIR)
  329. cp -R buttons $(DOCINSTALLDIR)
  330. cp -R search $(DOCINSTALLDIR)
  331. rm -f $(DOCINSTALLDIR)/search/*.linux
  332. cp -R $(HTML) $(DOCINSTALLDIR)
  333. find $(DOCINSTALLDIR) -name 'CVS' | xargs -n1 rm -rf
  334. www-install: psdist htmlinstall
  335. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  336. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  337. install:
  338. @echo Choose install from:
  339. @echo pdfinstall,htmlinstall,htmldosinstall
  340. @exit
  341. #####################################################################
  342. # Archives
  343. #####################################################################
  344. psdist: $(PS)
  345. tar -cvzf fpcdocps.tar.gz $(PS)
  346. zip docs-ps $(PS)
  347. pdfdist: pdf
  348. zip docs-pdf $(PDF)
  349. dvidist: dvi
  350. zip docs-dvi $(DVI)
  351. txtdist: txt
  352. zip docs-txt $(TXT)
  353. #####################################################################
  354. # Zips of htmls
  355. #####################################################################
  356. DOCPREFIX=doc
  357. BASEDIR=$(shell pwd)
  358. htmltar:
  359. $(MAKE) htmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  360. cd $(DOCPREFIX) ; tar cz * > $(BASEDIR)/fpcdoc.tar.gz ; cd $(BASEDIR)
  361. rm -rf $(DOCPREFIX)
  362. htmlzip:
  363. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  364. zip -D9rq doc-html $(DOCPREFIX)/*
  365. rm -rf $(DOCPREFIX)
  366. htmzip:
  367. $(MAKE) doshtmlinstall DOCINSTALLDIR=$(DOCPREFIX)
  368. makehtm `find $(DOCPREFIX) -name '*.html'`
  369. zip -D9rq doc-htm `find $(DOCPREFIX) -name '*.htm' -or -name '*.gif' -or -name '*.css'`
  370. rm -rf $(DOCPREFIX)
  371. htmldist: htmlzip htmltar
  372. htmdist: htmzip
  373. alldist: dvidist psdist txtdist pdfdist htmldist htmdist
  374. distclean: clean
  375. -rm -f *.tar.gz *.zip
  376. #####################################################################
  377. # Examples
  378. #####################################################################
  379. examples:
  380. $(MAKE) -C crtex
  381. $(MAKE) -C dosex
  382. $(MAKE) -C optex
  383. $(MAKE) -C printex
  384. $(MAKE) -C refex
  385. $(MAKE) -C stringex
  386. $(MAKE) -C ipcex
  387. $(MAKE) -C objectex
  388. $(MAKE) -C sysutex
  389. dosexamples: examples
  390. $(MAKE) -C go32ex
  391. $(MAKE) -C mouseex
  392. linuxexamples: examples
  393. $(MAKE) -C linuxex
  394. $(MAKE) -C sockex
  395. $(MAKE) -C ipcex
  396. #
  397. # $Log$
  398. # Revision 1.4 2000-10-12 10:41:58 peter
  399. # * more examples
  400. #
  401. # Revision 1.3 2000/09/02 21:51:36 peter
  402. # * fixed pdf creating (merged)
  403. #
  404. # Revision 1.1 2000/07/13 09:10:03 michael
  405. # + Initial import
  406. #