0.8.18.23:
[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 # SBCL_SYSTEM is an optional argument to this make program. If this
22 # variable is set, its contents are used as the command line for
23 # invoking SBCL.
24
25 # When passing a non-standard SBCL_SYSTEM, be sure to set the
26 # environment variable SBCL_HOME to a useful value, as well.
27
28 ifeq ($(MAKEINFO),)
29   MAKEINFO:=makeinfo
30 endif
31
32 ifeq ($(TEXI2PDF),)
33   TEXI2PDF:=texi2pdf
34 endif
35
36 ifeq ($(DVIPS),)
37   DVIPS:=dvips
38 endif
39
40 .PHONY: all
41 all: asdf.texinfo ps pdf info html
42
43 .PHONY: dist
44 dist: html pdf
45
46 asdf.texinfo:
47         rm -f asdf.texinfo
48         ln -s ../../contrib/asdf/asdf.texinfo
49
50 # html documentation; output in $(HTMLDIRS)
51 .PHONY: html
52 html: html-stamp
53
54 html-stamp: $(DOCFILES) docstrings
55         @rm -rf $(HTMLDIRS)
56         $(MAKEINFO) $(I_FLAGS) --html $(SBCLTEXI)
57         $(MAKEINFO) --html $(ASDFTEXI)
58         touch html-stamp
59
60 # Postscript documentation
61 .PHONY: ps
62 ps: $(PSFILES)
63
64 %.ps: %.dvi
65         dvips -o $@ $<
66
67 # DVI generation
68 %.dvi: %.texinfo $(DOCFILES) docstrings
69         texi2dvi $(I_FLAGS) $<
70
71 # PDF documentation
72 .PHONY: pdf
73 pdf: $(PDFFILES)
74
75 %.pdf: %.texinfo $(DOCFILES) docstrings
76         texi2pdf $(I_FLAGS) $<
77
78 # info docfiles
79 .PHONY: info
80 info: $(INFOFILES)
81
82 %.info: %.texinfo $(DOCFILES) docstrings
83         $(MAKEINFO) $(I_FLAGS) $<
84
85 # Texinfo docstring snippets
86 .PHONY: docstrings
87 docstrings: tempfiles-stamp
88
89 tempfiles-stamp:
90         DOCSTRINGDIR=$(DOCSTRINGDIR) PACKAGES=$(PACKAGES) MODULES=$(MODULES) sh make-tempfiles.sh "$(SBCL_SYSTEM)" && touch tempfiles-stamp
91
92
93 .PHONY: clean
94 clean: 
95         rm -f *~ *.bak *.orig \#*\# .\#* texput.log *.fasl
96         rm -rf $(HTMLDIRS) $(DOCSTRINGDIR)
97         rm -f contrib-docs.texi-temp
98         rm -f package-locks.texi-temp
99         rm -f $(PSFILE) $(PDFFILE) $(DVIFILE) html-stamp tempfiles-stamp
100         rm -f $(TMPFILES)
101         rm -f sbcl.info sbcl.info-*
102
103 .PHONY: distclean
104 distclean: clean