Debian Codegraph @

docs/manual/Makefile

raw
1 ##############################################################################
2 # Variables
3 ##############################################################################
4
5 ifneq ($(MAKECMDGOALS),distclean)
6 include ../../Makefile.config
7 -include ../../Makefile.local
8 endif
9 HEVEA = hevea
10 HEVEA_XXDATE := $(shell ./find-xxdate)
11
12 $(if $(HEVEA_XXDATE),,$(error Hevea: Unable to find xxdate.exe))
13
14 HEVEA_CMD := $(HEVEA) -exec $(HEVEA_XXDATE)
15
16 MAINSRC=main.tex
17 SRC=$(wildcard *.tex)
18 PDFLATEX_CMD=$(PDFLATEX) -halt-on-error
19 PDF=manual.pdf main_grammar.pdf options.pdf
20
21 #tools:
22 # latex, pdflatex
23 # xfig
24 # emacs, auctex, ediff
25 # darcs
26 # latexdiff
27
28 ##############################################################################
29 # Top rules
30 ##############################################################################
31 .PHONY: all clean distclean
32 .SUFFIXES: .pdf .tex
33
34 all: pdf html
35
36 pdf: $(PDF)
37
38 manual.pdf: $(SRC)
39 $(PDFLATEX_CMD) manual.tex
40 $(PDFLATEX_CMD) manual.tex
41
42 main_grammar.pdf: main_grammar.tex cocci_syntax.tex flow1.c flow2.c macros_listing_cocci.tex macros_grammar.tex macros_common.tex examples.tex tips.tex
43 #spatch --control-flow-to-file flow1.c
44 #spatch --control-flow-to-file flow2.c
45 #dot -Gsize="0.5,0.5" -Tpdf flow1:main.dot > flow1.pdf
46 #dot -Gsize="0.5,0.5" -Tpdf flow2:main.dot > flow2.pdf
47 $(PDFLATEX_CMD) main_grammar.tex
48 $(PDFLATEX_CMD) main_grammar.tex
49
50 options.pdf: main_options.tex spatch_options.tex macros_options.tex
51 $(PDFLATEX_CMD) options.tex
52 $(PDFLATEX_CMD) options.tex
53
54 distclean:: clean
55 @if test -z "${KEEP_GENERATED}"; then \
56 rm -f manual.pdf cocci_syntax.pdf options.pdf; fi
57
58
59 # lindig trick
60 #RERUN = Rerun (LaTeX|to get cross-references right)
61 #
62 #pdf: $(PDF)
63 #
64 #%.pdf: %.tex
65 # $(PDFLATEX) $<
66 # if egrep -s '$(RERUN)' $*.log ;then $(PDFLATEX) $<; fi
67 # if egrep -s '$(RERUN)' $*.log ;then $(PDFLATEX) $<; fi
68
69 ##############################################################################
70 # Html version
71 ##############################################################################
72 .PHONY: html check
73
74 .SUFFIXES: .html .tex
75
76 TEX=main_grammar.tex
77 WEBBASE?=~/website
78 WEBDOCS=$(WEBBASE)/docs
79
80 HTML=$(TEX:.tex=.html)
81
82 html: $(HTML)
83
84 clean::
85 rm -f *.aux *.dvi *.pdf *.html *.haux *.htoc *.log *.out *~
86
87 distclean:: clean
88 @if test -z "${KEEP_GENERATED}"; then \
89 rm -f *.pdf *.html *.gif *.css; fi
90
91 check: $(HTML)
92 checklink $<
93
94 .tex.html:
95 $(HEVEA_CMD) $<
96 $(HEVEA_CMD) $<
97 hacha -o index.html main_grammar.html
98
99 ##############################################################################
100 # Install
101 ##############################################################################
102
103 install: all
104 cp *.css *.gif *.html $(WEBDOCS)
105 cp $(PDF) $(WEBDOCS)
106 # chown apache:apache -R $(WEBDOCS)
107 # chmod a-w -R $(WEBDOCS)
108
109 ##############################################################################
110 # Developer rules
111 ##############################################################################
112
113 LATEXDIFFOPT=--type=CTRADITIONAL
114
115 #if multi files ? sed sur les \input{} ? ou create in another dir ?
116 latexdiff:
117 latexdiff $(LATEXDIFFOPT) main-old.tex main.tex > main-diff.tex
118 $(MAKE) MAINSRC=main-diff
119 rm -f main-diff.aux
120
121 replacediff:
122 cp main-old.tex main-older.tex
123 cp main.tex main-old.tex
124
125 clean::
126 rm -f main-diff.*
127
128 update:
129
130 commit:
131
132
133 ##############################################################################
134 # Generic rules
135 ##############################################################################
136 FORMAT=letter
137
138 %.ps: %.dvi
139 dvips -P cmz $< -o $@ -t $(FORMAT)
140
141 clean::
142 rm -f *.aux \
143 *.bbl \
144 *.blg \
145 *.dvi \
146 *.log \
147 *.out \
148 *.toc
149
150 include ../../Makefile.common