48c5ec5f7fad72f9fe5df44cc0562988e8a08de6
[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 HTMLDIR=$(basename $(ROOTFILE))
11 # The value of DOCSTRINGDIR has to end with a slash or you lose (it's
12 # passed to Lisp's `pathname' function).
13 DOCSTRINGDIR="docstrings/"
14
15
16 ifeq ($(MAKEINFO),)
17   MAKEINFO:=makeinfo
18 endif
19
20 ifeq ($(TEXI2PDF),)
21   TEXI2PDF:=texi2pdf
22 endif
23
24 ifeq ($(DVIPS),)
25   DVIPS:=dvips
26 endif
27
28 .PHONY: all
29 all: ps pdf info html
30
31 .PHONY: dist
32 dist: html pdf
33
34
35
36 # html documentation; output in $(HTMLDIR)
37 .PHONY: html
38 html: html-stamp
39
40 html-stamp: $(DOCFILES) docstrings
41         @rm -rf $(HTMLDIR)
42         $(MAKEINFO) -I $(DOCSTRINGDIR) --html $(ROOTFILE)
43         touch html-stamp
44
45 # Postscript documentation
46 .PHONY: ps
47 ps: $(PSFILE)
48
49 $(PSFILE): $(DVIFILE)
50         dvips -o $@ $<
51
52 $(DVIFILE): $(DOCFILES) docstrings
53         texi2dvi -I $(DOCSTRINGDIR) $(ROOTFILE)
54
55 # PDF documentation
56 .PHONY: pdf
57 pdf: $(PDFFILE)
58
59 $(PDFFILE): $(DOCFILES) docstrings
60         texi2pdf -I $(DOCSTRINGDIR) $(ROOTFILE)
61
62 # info docfiles
63 .PHONY: info
64 info: $(INFOFILE)
65
66 $(INFOFILE): $(DOCFILES) docstrings
67         $(MAKEINFO) -I $(DOCSTRINGDIR) $(ROOTFILE)
68
69 # Texinfo docstring snippets; output hardcoded in docstrings/ for now.
70 .PHONY: docstrings
71 docstrings: docstrings-stamp
72
73 docstrings-stamp:
74         DOCSTRINGDIR=$(DOCSTRINGDIR) sh docstrings.sh
75         touch docstrings-stamp
76
77
78
79 .PHONY: clean
80 clean: 
81         rm -f *~ *.bak *.orig \#*\# .\#* texput.log
82         rm -rf $(HTMLDIR) $(DOCSTRINGDIR)
83         rm -f $(PSFILE) $(PDFFILE) $(DVIFILE) html-stamp docstrings-stamp
84         rm -f $(TMPFILES)
85         rm -f sbcl.info sbcl.info-*
86
87 .PHONY: distclean
88 distclean: clean