0.8.14.20: Documentation madness, yet again
[sbcl.git] / doc / manual / Makefile
1 SBCLTEXI:=sbcl.texinfo
2 ASDFTEXI:=asdf.texinfo
3 DOCFILES:=*.texinfo $(ASDFTEXI)
4 TMPTYPES:=aux cps fns ky log pg toc tps vrs
5 TMPFILES:=$(foreach target,asdf sbcl,$(foreach type,$(TMPTYPES),$(target).$(type)))
6 PSFILES=sbcl.ps asdf.ps
7 PDFFILES=sbcl.pdf asdf.pdf
8 INFOFILES=sbcl.info asdf.info
9 HTMLDIRS=$(basename $(SBCLTEXI)) $(basename $(ASDFTEXI))
10 # Place where generated documentation ends up. The value of
11 # DOCSTRINGDIR has to end with a slash or you lose (it's passed to
12 # Lisp's `pathname' function).
13 DOCSTRINGDIR="docstrings/"
14 I_FLAGS=-I $(DOCSTRINGDIR) -I ../../contrib/
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 :sb-grovel :sb-sprof :sb-bsd-sockets'
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 :SB-SPROF :SB-BSD-SOCKETS"
20
21 ifeq ($(MAKEINFO),)
22   MAKEINFO:=makeinfo
23 endif
24
25 ifeq ($(TEXI2PDF),)
26   TEXI2PDF:=texi2pdf
27 endif
28
29 ifeq ($(DVIPS),)
30   DVIPS:=dvips
31 endif
32
33 .PHONY: all
34 all: asdf.texinfo ps pdf info html
35
36 .PHONY: dist
37 dist: html pdf
38
39 asdf.texinfo:
40         rm -f asdf.texinfo
41         ln -s ../../contrib/asdf/asdf.texinfo
42
43 # html documentation; output in $(HTMLDIRS)
44 .PHONY: html
45 html: html-stamp
46
47 html-stamp: $(DOCFILES) docstrings
48         @rm -rf $(HTMLDIRS)
49         $(MAKEINFO) $(I_FLAGS) --html $(SBCLTEXI)
50         $(MAKEINFO) --html $(ASDFTEXI)
51         touch html-stamp
52
53 # Postscript documentation
54 .PHONY: ps
55 ps: $(PSFILES)
56
57 %.ps: %.dvi
58         dvips -o $@ $<
59
60 # DVI generation
61 %.dvi: %.texinfo $(DOCFILES) docstrings
62         texi2dvi $(I_FLAGS) $<
63
64 # PDF documentation
65 .PHONY: pdf
66 pdf: $(PDFFILES)
67
68 %.pdf: %.texinfo $(DOCFILES) docstrings
69         texi2pdf $(I_FLAGS) $<
70
71 # info docfiles
72 .PHONY: info
73 info: $(INFOFILES)
74
75 %.info: %.texinfo $(DOCFILES) docstrings
76         $(MAKEINFO) $(I_FLAGS) $<
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 && touch tempfiles-stamp
84
85
86 .PHONY: clean
87 clean: 
88         rm -f *~ *.bak *.orig \#*\# .\#* texput.log *.fasl
89         rm -rf $(HTMLDIRS) $(DOCSTRINGDIR)
90         rm -f contrib-docs.texi-temp
91         rm -f package-locks.texi-temp
92         rm -f $(PSFILE) $(PDFFILE) $(DVIFILE) html-stamp tempfiles-stamp
93         rm -f $(TMPFILES)
94         rm -f sbcl.info sbcl.info-*
95
96 .PHONY: distclean
97 distclean: clean