0.8.9.39:
[sbcl.git] / doc / manual / Makefile
1
2 DOCFILES:=$(shell echo *.texinfo)
3 ROOTFILE:=sbcl.texinfo
4 TMPFILES:=sbcl.aux sbcl.cp sbcl.fn sbcl.ky sbcl.log sbcl.pg sbcl.toc sbcl.tp sbcl.vr
5
6 PSFILE=sbcl.ps
7 PDFFILE=sbcl.pdf
8 DVIFILE=sbcl.dvi
9 INFOFILE=sbcl.info
10 HTMLDIR=$(basename $(ROOTFILE))
11 # Place where generated documentation ends up. The value of
12 # DOCSTRINGDIR has to end with a slash or you lose (it's passed to
13 # Lisp's `pathname' function).
14 DOCSTRINGDIR="docstrings/"
15 # List of contrib modules that docstring docs will be created for.
16 # FIXME: should check test-passed and not load them.
17 MODULES=':sb-md5 :sb-rotate-byte'
18 # List of package names that docstring docs will be created for.
19 PACKAGES=":COMMON-LISP :SB-ALIEN :SB-DEBUG :SB-EXT :SB-GRAY :SB-MOP :SB-PROFILE :SB-THREAD :SB-MD5 :SB-ROTATE-BYTE"
20
21
22 ifeq ($(MAKEINFO),)
23   MAKEINFO:=makeinfo
24 endif
25
26 ifeq ($(TEXI2PDF),)
27   TEXI2PDF:=texi2pdf
28 endif
29
30 ifeq ($(DVIPS),)
31   DVIPS:=dvips
32 endif
33
34 .PHONY: all
35 all: ps pdf info html
36
37 .PHONY: dist
38 dist: html pdf
39
40
41
42 # html documentation; output in $(HTMLDIR)
43 .PHONY: html
44 html: html-stamp
45
46 html-stamp: $(DOCFILES) docstrings
47         @rm -rf $(HTMLDIR)
48         $(MAKEINFO) -I $(DOCSTRINGDIR) --html $(ROOTFILE)
49         touch html-stamp
50
51 # Postscript documentation
52 .PHONY: ps
53 ps: $(PSFILE)
54
55 $(PSFILE): $(DVIFILE)
56         dvips -o $@ $<
57
58 $(DVIFILE): $(DOCFILES) docstrings
59         texi2dvi -I $(DOCSTRINGDIR) $(ROOTFILE)
60
61 # PDF documentation
62 .PHONY: pdf
63 pdf: $(PDFFILE)
64
65 $(PDFFILE): $(DOCFILES) docstrings
66         texi2pdf -I $(DOCSTRINGDIR) $(ROOTFILE)
67
68 # info docfiles
69 .PHONY: info
70 info: $(INFOFILE)
71
72 $(INFOFILE): $(DOCFILES) docstrings
73         $(MAKEINFO) -I $(DOCSTRINGDIR) $(ROOTFILE)
74
75 # contrib-modules.texinfo includes contrib-doc-list.texi-temp
76 contrib-modules.texinfo: tempfiles-stamp
77
78 # Texinfo docstring snippets
79 .PHONY: docstrings
80 docstrings: tempfiles-stamp
81
82 tempfiles-stamp:
83         DOCSTRINGDIR=$(DOCSTRINGDIR) PACKAGES=$(PACKAGES) MODULES=$(MODULES) sh make-tempfiles.sh
84         touch tempfiles-stamp
85
86
87 .PHONY: clean
88 clean: 
89         rm -f *~ *.bak *.orig \#*\# .\#* texput.log *.fasl
90         rm -rf $(HTMLDIR) $(DOCSTRINGDIR)
91         rm -f contrib-docs.texi-temp
92         rm -f $(PSFILE) $(PDFFILE) $(DVIFILE) html-stamp tempfiles-stamp
93         rm -f $(TMPFILES) contrib-doc-list.texi-temp
94         rm -f sbcl.info sbcl.info-*
95
96 .PHONY: distclean
97 distclean: clean