aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/Makefile
blob: 52826e2cf3e6b56a306cde40464150c55764c724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
##
## Makefile for Proof General doc directory.
##
## Author:  David Aspinall <da@dcs.ed.ac.uk>
##
## Maintainer:  Proof General maintainer <proofgen@dcs.ed.ac.uk>
##
## $Id$
## 
###########################################################################
##
## Use:
##	make info,dvi,pdf,html    - build respective docs from texi source.
##	make doc		  - make all kinds of doc.
##
###########################################################################

DOCNAME = ProofGeneral

MAKEINFO = makeinfo
TEXI2DVI = texi2dvi

DVICONCAT = dviconcat
DVISELECT = dviselect

# Assumes actual first two pages belong to titlepage
TITLERANGE = =1,=2

# Assumes that main document starts on third actual page
MAINRANGE = =3,=4,3:

TOC = :_1

DVI2PS = dvips
TEXI2PDF = texi2pdf
TEXI2HTML = texi2html
EMACS = xemacs -batch

.SUFFIXES:  .texi .info .dvi .html .pdf .ps

.texi.info:
	$(MAKEINFO) $< 

.texi.dvi:
	$(TEXI2DVI) $<
	$(DVISELECT) -i $*.dvi -o $*.tmp1 $(TITLERANGE)
	$(DVISELECT) -i $*.dvi -o $*.tmp2 $(MAINRANGE)
	$(DVISELECT) -i $*.dvi -o $*.tmp3 $(TOC)
	$(DVICONCAT) -o $*.dvi $*.tmp1 $*.tmp3 $*.tmp2 
	rm -f $*.tmp1 $*.tmp2 $*.tmp3


.texi.pdf:
	$(TEXI2PDF) $< 

.dvi.ps:
	$(DVI2PS) $< -o $*.ps

.texi.html:	
	$(TEXI2HTML) -split_chapter $< 

## 
## doc : build info and dvi files from $(DOCNAME).texi
##
doc:	dvi info

## 
## all : build dvi, ps, html, info
##
all:    dvi ps html info

dvi:    $(DOCNAME).dvi
ps:	$(DOCNAME).ps
pdf:    $(DOCNAME).pdf
html:   $(DOCNAME).html
info:   $(DOCNAME).info

# NB: for info, could make localdir automatically from
# START-INFO-DIR-ENTRY / END-INFO-DIR-ENTRY.
# Does some utility do this?

##
## clean: Remove subsidiary documentation files
##
clean:
	rm -f $(DOCNAME).?? $(DOCNAME).fns $(DOCNAME).vrs $(DOCNAME).cps 
	rm -f $(DOCNAME).aux $(DOCNAME).log $(DOCNAME).toc $(DOCNAME).cp0
	rm -f $(DOCNAME).kys
	rm -f *~

##
## distclean: Remove documentation targets
##
distclean:   clean
	rm -f $(DOCNAME).info* $(DOCNAME).dvi $(DOCNAME)*.ps $(DOCNAME).pdf $(DOCNAME)*.html 

##
## texi: update magic comments in texi from docstrings in code.
##	  (developer use only!)
##
$(DOCNAME).texi: ../*/*.el 
	$(MAKE) magic
magic:
	$(EMACS) -l docstring-magic.el $(DOCNAME).texi -f texi-docstring-magic -f save-buffer