0.8.13.75: MORE MANUALS
[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 VARSFILE=variables.template
10 HTMLDIRS=$(basename $(SBCLTEXI)) $(basename $(ASDFTEXI))
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 I_FLAGS=-I $(DOCSTRINGDIR) -I ../../contrib/
16 # List of contrib modules that docstring docs will be created for.
17 # FIXME: should check test-passed and not load them.
18 MODULES=':sb-md5 :sb-rotate-byte :sb-grovel :sb-sprof :sb-bsd-sockets'
19 # List of package names that docstring docs will be created for.
20 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"
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: asdf.texinfo ps pdf info html
36
37 .PHONY: dist
38 dist: html pdf
39
40 asdf.texinfo:
41         rm -f asdf.texinfo
42         ln -s ../../contrib/asdf/asdf.texinfo
43
44 variables: ${VARSFILE}
45         ./extract-values.sh < ${VARSFILE} >variables.texinfo
46
47 # html documentation; output in $(HTMLDIRS)
48 .PHONY: html
49 html: html-stamp
50
51 html-stamp: variables $(DOCFILES) docstrings
52         @rm -rf $(HTMLDIRS)
53         $(MAKEINFO) $(I_FLAGS) --html $(SBCLTEXI)
54         $(MAKEINFO) --html $(ASDFTEXI)
55         touch html-stamp
56
57 # Postscript documentation
58 .PHONY: ps
59 ps: $(PSFILES)
60
61 %.ps: %.dvi
62         dvips -o $@ $<
63
64 # DVI generation
65 %.dvi: %.texinfo variables $(DOCFILES) docstrings
66         texi2dvi $(I_FLAGS) $<
67
68 # PDF documentation
69 .PHONY: pdf
70 pdf: $(PDFFILES)
71
72 %.pdf: %.texinfo variables $(DOCFILES) docstrings
73         texi2pdf $(I_FLAGS) $<
74
75 # info docfiles
76 .PHONY: info
77 info: $(INFOFILES)
78
79 %.info: %.texinfo variables $(DOCFILES) docstrings
80         $(MAKEINFO) $(I_FLAGS) $<
81
82 # Texinfo docstring snippets
83 .PHONY: docstrings
84 docstrings: tempfiles-stamp
85
86 tempfiles-stamp:
87         DOCSTRINGDIR=$(DOCSTRINGDIR) PACKAGES=$(PACKAGES) MODULES=$(MODULES) sh make-tempfiles.sh && touch tempfiles-stamp
88
89
90 .PHONY: clean
91 clean: 
92         rm -f *~ *.bak *.orig \#*\# .\#* texput.log *.fasl
93         rm -rf $(HTMLDIRS) $(DOCSTRINGDIR)
94         rm -f contrib-docs.texi-temp
95         rm -f package-locks.texi-temp
96         rm -f $(PSFILE) $(PDFFILE) $(DVIFILE) html-stamp tempfiles-stamp
97         rm -f $(TMPFILES)
98         rm -f sbcl.info sbcl.info-*
99
100 .PHONY: distclean
101 distclean: clean