0.8.12.7: Merge package locks, AKA "what can go wrong with a 3783 line patch?"
[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 VARSFILE=variables.template
11 HTMLDIR=$(basename $(ROOTFILE))
12 # Place where generated documentation ends up. The value of
13 # DOCSTRINGDIR has to end with a slash or you lose (it's passed to
14 # Lisp's `pathname' function).
15 DOCSTRINGDIR="docstrings/"
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'
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"
21
22
23 ifeq ($(MAKEINFO),)
24   MAKEINFO:=makeinfo
25 endif
26
27 ifeq ($(TEXI2PDF),)
28   TEXI2PDF:=texi2pdf
29 endif
30
31 ifeq ($(DVIPS),)
32   DVIPS:=dvips
33 endif
34
35 .PHONY: all
36 all: ps pdf info html
37
38 .PHONY: dist
39 dist: html pdf
40
41
42 variables: ${VARSFILE}
43         ./extract-values.sh < ${VARSFILE} >variables.texinfo
44
45 # html documentation; output in $(HTMLDIR)
46 .PHONY: html
47 html: html-stamp
48
49 html-stamp: variables $(DOCFILES) docstrings
50         @rm -rf $(HTMLDIR)
51         $(MAKEINFO) -I $(DOCSTRINGDIR) --html $(ROOTFILE)
52         touch html-stamp
53
54 # Postscript documentation
55 .PHONY: ps
56 ps: $(PSFILE)
57
58 $(PSFILE): $(DVIFILE)
59         dvips -o $@ $<
60
61 $(DVIFILE): variables $(DOCFILES) docstrings
62         texi2dvi -I $(DOCSTRINGDIR) $(ROOTFILE)
63
64 # PDF documentation
65 .PHONY: pdf
66 pdf: $(PDFFILE)
67
68 $(PDFFILE): variables $(DOCFILES) docstrings
69         texi2pdf -I $(DOCSTRINGDIR) $(ROOTFILE)
70
71 # info docfiles
72 .PHONY: info
73 info: $(INFOFILE)
74
75 $(INFOFILE): variables $(DOCFILES) docstrings
76         $(MAKEINFO) -I $(DOCSTRINGDIR) $(ROOTFILE)
77
78 # contrib-modules.texinfo includes contrib-doc-list.texi-temp
79 contrib-modules.texinfo: tempfiles-stamp
80
81 # Texinfo docstring snippets
82 .PHONY: docstrings
83 docstrings: tempfiles-stamp
84
85 tempfiles-stamp:
86         DOCSTRINGDIR=$(DOCSTRINGDIR) PACKAGES=$(PACKAGES) MODULES=$(MODULES) sh make-tempfiles.sh && touch tempfiles-stamp
87
88
89 .PHONY: clean
90 clean: 
91         rm -f *~ *.bak *.orig \#*\# .\#* texput.log *.fasl
92         rm -rf $(HTMLDIR) $(DOCSTRINGDIR)
93         rm -f contrib-docs.texi-temp
94         rm -f package-locks.texi-temp
95         rm -f $(PSFILE) $(PDFFILE) $(DVIFILE) html-stamp tempfiles-stamp
96         rm -f $(TMPFILES) contrib-doc-list.texi-temp
97         rm -f sbcl.info sbcl.info-*
98
99 .PHONY: distclean
100 distclean: clean