Makefile 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. # Where do you want the html files to be put ?
  19. ifndef DOCINSTALLDIR
  20. DOCINSTALLDIR=/usr/doc/fpc-0.99.5
  21. endif
  22. #
  23. # Program definitions
  24. #
  25. # Latex
  26. ifndef LATEX
  27. LATEX = latex
  28. endif
  29. # Latex2html conversion.
  30. ifndef LATEX2HTML
  31. LATEX2HTML = latex2html
  32. endif
  33. # Options for converter
  34. ifndef LATEX2HTMLOPTS
  35. LATEX2HTMLOPTS = -no_reuse -up_url "../fpctoc.html"\
  36. -up_title "Free Pascal manuals" -contents_in_navigation\
  37. -html_version 3.0
  38. endif
  39. # Ascii mode ? (i.e. no pics)
  40. ifndef ASCIIMODE
  41. ASCIIMODE=NO
  42. #ASCIIMODE=YES
  43. endif
  44. # DVI to PS converter
  45. ifndef DVIPS
  46. DVIPS=dvips
  47. endif
  48. # DVI to TXT converter
  49. ifndef DVITXT
  50. DVITXT=dvi2tty -w132
  51. endif
  52. # PDF converter
  53. ifndef PDFLATEX
  54. PDFLATEX=pdflatex
  55. endif
  56. # Makeindex programma
  57. ifndef MAKEINDEX
  58. MAKEINDEX=makeindex
  59. endif
  60. #
  61. #######################################################################
  62. # End of configurable section. Do not edit after this line.
  63. #######################################################################
  64. HTML = user units ref prog
  65. PS = $(addsuffix .ps, $(HTML))
  66. DVI = $(addsuffix .dvi, $(HTML))
  67. TXT = $(addsuffix .txt, $(HTML))
  68. PDF = $(addsuffix .pdf, $(HTML))
  69. CHAPTERS = $(addsuffix .tex, crt dos getopts go32 graph linux printer strings)
  70. # Check if ascii-mode requested
  71. ifeq ($(ASCIIMODE),YES)
  72. LATEX2HTMLOPTS:=$(LATEX2HTMLOPTS) -ascii_mode
  73. endif
  74. #####################################################################
  75. # Conversion from types
  76. #####################################################################
  77. .PHONY: all clean dvi help html ps psdist htmldist htm txt pdf refex
  78. .SUFFIXES: .dvi .tex .ps .txt .pdf
  79. # default show help
  80. all: help
  81. .dvi.ps:
  82. $(DVIPS) $<
  83. .tex.dvi:
  84. $(LATEX) $*
  85. -$(MAKEINDEX) $*
  86. $(LATEX) $*
  87. -$(MAKEINDEX) $*
  88. $(LATEX) $*
  89. .dvi.txt:
  90. $(DVITXT) -o $*.txt $*.dvi
  91. .tex.pdf:
  92. $(PDFLATEX) $*pdf
  93. -$(MAKEINDEX) $*pdf
  94. $(PDFLATEX) $*pdf
  95. -$(MAKEINDEX) $*pdf
  96. $(PDFLATEX) $*pdf
  97. $(TXT) : %.txt: %.dvi
  98. $(DVI) : %.dvi: %.tex
  99. $(PDF) : %.pdf: %.tex
  100. #####################################################################
  101. # Targets
  102. #####################################################################
  103. help:
  104. @echo 'Possible targets :'
  105. @echo ' dvi : Make documentation using latex.'
  106. @echo ' ps : Make documentation using latex and dvips.'
  107. @echo ' html : Make documentation using latex2html.'
  108. @echo ' htm : Convert .html to .htm files, zip result'
  109. @echo ' clean : Clean up the mess.'
  110. clean:
  111. -rm -rf $(HTML)
  112. -rm -f *.aux *.log *.dvi *.ps *.toc *.i* *.lot *.pdf *.txt *.chk
  113. -$(MAKE) -C refex clean
  114. -$(MAKE) -C linuxex clean
  115. -$(MAKE) -C crtex clean
  116. -$(MAKE) -C dosex clean
  117. -$(MAKE) -C optex clean
  118. -$(MAKE) -C printex clean
  119. -$(MAKE) -C stringex clean
  120. -$(MAKE) -C sockex clean
  121. -$(MAKE) -C mouseex clean
  122. unitex.chk:
  123. $(MAKE) -C crtex tex
  124. $(MAKE) -C linuxex tex
  125. $(MAKE) -C dosex tex
  126. $(MAKE) -C optex tex
  127. $(MAKE) -C printex tex
  128. $(MAKE) -C stringex tex
  129. $(MAKE) -C sockex tex
  130. $(MAKE) -C mouseex tex
  131. touch unitex.chk
  132. refex.chk:
  133. $(MAKE) -C refex tex
  134. touch refex.chk
  135. units.dvi: units.tex $(CHAPTERS) unitex.chk
  136. ref.dvi: ref.tex refex.chk
  137. dvi : $(DVI)
  138. txt : dvi $(TXT)
  139. ps : dvi $(PS)
  140. pdf : unitex.chk refex.chk $(PDF)
  141. user: user.chk
  142. user.chk: user.tex
  143. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  144. -t "User's guide for Free Pascal" user.tex
  145. sed -f foot.sed <user/footnode.html >user/footnote.html
  146. mv user/footnote.html user/footnode.html
  147. rm -f user/labels.pl user/internals.pl user/.*.pag user/.*.dir
  148. rm -f user/images.* user/*.log
  149. touch user.chk
  150. units: units.chk
  151. units.chk: units.tex unitex.chk
  152. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  153. -t "Unit reference for Free Pascal" units.tex
  154. sed -f foot.sed <units/footnode.html >units/footnote.html
  155. mv units/footnote.html units/footnode.html
  156. rm -f units/labels.pl units/internals.pl units/.*.pag units/.*.dir
  157. touch units.chk
  158. ref: ref.chk
  159. ref.chk: refex.chk ref.tex
  160. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 3 -link 2\
  161. -t "Free Pascal reference guide" ref.tex
  162. sed -f foot.sed <ref/footnode.html >ref/footnote.html
  163. mv ref/footnote.html ref/footnode.html
  164. rm -f ref/labels.pl ref/internals.pl ref/.*.pag ref/.*.dir
  165. touch ref.chk
  166. prog: prog.chk
  167. prog.chk: prog.tex
  168. $(LATEX2HTML) $(LATEX2HTMLOPTS) -split 2 -link 2\
  169. -t "Free Pascal programmers guide" prog.tex
  170. sed -f foot.sed <prog/footnode.html >prog/footnote.html
  171. mv prog/footnote.html prog/footnode.html
  172. rm -f prog/labels.pl prog/internals.pl prog/.*.pag prog/.*.dir
  173. touch prog.chk
  174. html: $(HTML)
  175. htm:
  176. makehtm `find . -name '*.html'`
  177. zip fpcdoc `find . -name '*.htm'`
  178. rm `find -name '*.htm'`
  179. all-formats: ps txt pdf html
  180. #####################################################################
  181. # Installation
  182. #####################################################################
  183. install:
  184. install -d -m 755 $(DOCINSTALLDIR)
  185. cp fpctoc.html $(DOCINSTALLDIR)
  186. cp -R buttons $(DOCINSTALLDIR)
  187. cp -R $(HTML) $(DOCINSTALLDIR)
  188. www-install: psdist htmldist htm
  189. scp fpcdoc.zip fpcdocps.zip fpcdocps.tar.gz fpcdoc.tar.gz tfdec1:htdocs/fpk
  190. ssh tfdec1 '(cd htdocs/fpk/docs ; /usr/local/bin/tar -xzf ../fpcdoc.tar.gz)'
  191. #####################################################################
  192. # Distribution
  193. #####################################################################
  194. psdist: ps
  195. tar -cvzf fpcdocps.tar.gz *.ps
  196. zip fpcdocps *.ps
  197. pdfdist: pdf
  198. zip fpcdocpdf *.pdf
  199. htmldist: html
  200. find . -name '*.html' >htmllist
  201. find . -name '*.gif' >>htmllist
  202. tar -czvf fpcdoc.tar.gz --files-from=htmllist
  203. rm -f htmllist
  204. dist:
  205. -mkdir $(DISTDIR)/docs
  206. cp Makefile README.DOCS makehtm fpktoc.html $(DISTDIR)/docs
  207. cp *.tex *.sty *.perl *.doc $(DISTDIR)/docs
  208. distclean: clean
  209. -rm -f *.tar.gz *.zip