Release coccinelle-0.1.8
[bpt/coccinelle.git] / docs / manual / Makefile
CommitLineData
708f4980
C
1##############################################################################
2# Variables
3##############################################################################
4
5MAINSRC=main.tex
6SRC=$(wildcard *.tex)
7
8#tools:
9# latex, pdflatex
10# xfig
11# emacs, auctex, ediff
12# darcs
13# latexdiff
14
15##############################################################################
16# Top rules
17##############################################################################
18.PHONY: all clean distclean
19.SUFFIXES: .pdf .tex
20
21all: manual.pdf cocci_syntax.pdf options.pdf
22
23manual.pdf: $(SRC)
24 pdflatex main.tex
25 pdflatex main.tex
26 mv main.pdf manual.pdf
27
28
29
30
31cocci_syntax.pdf: main_grammar.tex cocci_syntax.tex macros_listing_cocci.tex macros_grammar.tex macros_common.tex examples.tex tips.tex
32 pdflatex main_grammar.tex
33 pdflatex main_grammar.tex
34 mv main_grammar.pdf cocci_syntax.pdf
35
36options.pdf: main_options.tex spatch_options.tex macros_options.tex
37 pdflatex main_options.tex
38 pdflatex main_options.tex
39 mv main_options.pdf options.pdf
40
41
42
43
44distclean:: clean
45 rm -f manual.pdf cocci_syntax.pdf options.pdf
46
47
48# lindig trick
49#RERUN = Rerun (LaTeX|to get cross-references right)
50#
51#pdf: $(PDF)
52#
53#%.pdf: %.tex
54# $(PDFLATEX) $<
55# if egrep -s '$(RERUN)' $*.log ;then $(PDFLATEX) $<; fi
56# if egrep -s '$(RERUN)' $*.log ;then $(PDFLATEX) $<; fi
57
58##############################################################################
59# Html version
60##############################################################################
61.PHONY: html check
62
63.SUFFIXES: .html .tex
64
65TEX=cocci_syntax.tex
66WEB=/var/www/localhost/htdocs/coccinelle/
67EMNWEB=~/website/docs/
68
69PDF=$(TEX:.tex=.pdf)
70HTML=$(TEX:.tex=.html)
71
72html: $(HTML)
73
74clean::
75 rm -f *.aux *.dvi *.haux *.htoc *.log *.out *~
76
77distclean:: clean
78 rm -f *.pdf *.html *.gif *.css
79
80check: $(HTML)
81 checklink $<
82
83world: all html
84
85universe: world install
86
87install:
88 cp *.css *.gif *.html $(WEB)
89 cp $(PDF) $(WEB)
90 chown apache:apache -R $(WEB)
91 chmod a-w -R $(WEB)
92
93emn_install: world
94 cp *.css *.gif *.html $(EMNWEB)
95 cp $(PDF) $(EMNWEB)
96
97
98
99
100.tex.html:
101# For Gentoo: /usr/lib64/hevea
102# For Ubuntu family: /usr/share/hevea
103# For default installation
104 @if [ -f /usr/lib64/hevea/xxdate.exe ]; then \
105 hevea -exec /usr/lib64/hevea/xxdate.exe $< ; \
106 hevea -exec /usr/lib64/hevea/xxdate.exe $< ; \
107 elif [ -f /usr/share/hevea/xxdate.exe ]; then \
108 hevea -exec /usr/share/hevea/xxdate.exe $< ; \
109 hevea -exec /usr/share/hevea/xxdate.exe $< ; \
110 elif [ -f /usr/local/lib/hevea/xxdate.exe ]; then \
111 hevea -exec /usr/local/lib/hevea/xxdate.exe $< ; \
112 hevea -exec /usr/local/lib/hevea/xxdate.exe $< ; \
113 else \
114 echo -e "\n\n *** Hevea: Unable to find xxdate.exe ***\n\n"; \
115 fi
116 hacha -o index.html cocci_syntax.html
117
118
119##############################################################################
120# Install
121##############################################################################
122
123
124##############################################################################
125# Developer rules
126##############################################################################
127
128LATEXDIFFOPT=--type=CTRADITIONAL
129
130#if multi files ? sed sur les \input{} ? ou create in another dir ?
131latexdiff:
132 latexdiff $(LATEXDIFFOPT) main-old.tex main.tex > main-diff.tex
133 make MAINSRC=main-diff
134 rm -f main-diff.aux
135
136replacediff:
137 cp main-old.tex main-older.tex
138 cp main.tex main-old.tex
139
140clean::
141 rm -f main-diff.*
142
143update:
144
145commit:
146
147
148##############################################################################
149# Generic rules
150##############################################################################
151FORMAT=letter
152
153%.ps: %.dvi
154 dvips -P cmz $< -o $@ -t $(FORMAT)
155
156clean::
157 rm -f *.aux \
158 *.bbl \
159 *.blg \
160 *.dvi \
161 *.log \
162 *.out \
163 *.toc
164