d74b4227071d12da746931567ed1fa731a23846e
[sbcl.git] / doc / manual / Makefile
1 DOCFILES:=$(shell echo *.texinfo)
2 ROOTFILE:=sbcl.texinfo
3 TMPFILES:=sbcl.aux sbcl.cp sbcl.fn sbcl.ky sbcl.log sbcl.pg sbcl.toc sbcl.tp sbcl.vr
4
5 PSFILE=sbcl.ps
6 PDFFILE=sbcl.pdf
7 DVIFILE=sbcl.dvi
8 INFOFILE=sbcl.info
9 VARSFILE=variables.template
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 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: ps pdf info html
36
37 .PHONY: dist
38 dist: html pdf
39
40
41 variables: ${VARSFILE}
42         ./extract-values.sh < ${VARSFILE} >variables.texinfo
43
44 # html documentation; output in $(HTMLDIR)
45 .PHONY: html
46 html: html-stamp
47
48 html-stamp: variables $(DOCFILES) docstrings
49         @rm -rf $(HTMLDIR)
50         $(MAKEINFO) $(I_FLAGS) --html $(ROOTFILE)
51         touch html-stamp
52
53 # Postscript documentation
54 .PHONY: ps
55 ps: $(PSFILE)
56
57 $(PSFILE): $(DVIFILE)
58         dvips -o $@ $<
59
60 $(DVIFILE): variables $(DOCFILES) docstrings
61         texi2dvi $(I_FLAGS) $(ROOTFILE)
62
63 # PDF documentation
64 .PHONY: pdf
65 pdf: $(PDFFILE)
66
67 $(PDFFILE): variables $(DOCFILES) docstrings
68         texi2pdf $(I_FLAGS) $(ROOTFILE)
69
70 # info docfiles
71 .PHONY: info
72 info: $(INFOFILE)
73
74 $(INFOFILE): variables $(DOCFILES) docstrings
75         $(MAKEINFO) $(I_FLAGS) $(ROOTFILE)
76
77 # contrib-modules.texinfo includes contrib-doc-list.texi-temp
78 contrib-modules.texinfo: tempfiles-stamp
79
80 # Texinfo docstring snippets
81 .PHONY: docstrings
82 docstrings: tempfiles-stamp
83
84 tempfiles-stamp:
85         DOCSTRINGDIR=$(DOCSTRINGDIR) PACKAGES=$(PACKAGES) MODULES=$(MODULES) sh make-tempfiles.sh && touch tempfiles-stamp
86
87
88 .PHONY: clean
89 clean: 
90         rm -f *~ *.bak *.orig \#*\# .\#* texput.log *.fasl
91         rm -rf $(HTMLDIR) $(DOCSTRINGDIR)
92         rm -f contrib-docs.texi-temp
93         rm -f package-locks.texi-temp
94         rm -f $(PSFILE) $(PDFFILE) $(DVIFILE) html-stamp tempfiles-stamp
95         rm -f $(TMPFILES) contrib-doc-list.texi-temp
96         rm -f sbcl.info sbcl.info-*
97
98 .PHONY: distclean
99 distclean: clean