blob: 84836a28b5f7a360ba66c69d3bfff652d90487a7 [file] [log] [blame]
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +00001PSFILES=ip-cref.ps ip-tunnels.ps api-ip6-flowlabels.ps ss.ps nstat.ps arpd.ps rtstat.ps
2# tc-cref.ps
3# api-rtnl.tex api-pmtudisc.tex api-news.tex
4# iki-netdev.ps iki-neighdst.ps
5
6
7LATEX=latex
8DVIPS=dvips
9SGML2DVI=sgml2latex --output=dvi
10SGML2HTML=sgml2html -s 0
11LPR=lpr -Zsduplex
12SHELL=bash
13PAGESIZE=a4
14PAGESPERPAGE=2
15
16HTMLFILES=$(subst .sgml,.html,$(shell echo *.sgml))
17DVIFILES=$(subst .ps,.dvi,$(PSFILES))
18
19
20all: pstwocol
21
22pstwocol: $(PSFILES)
23
24html: $(HTMLFILES)
25
26dvi: $(DVIFILES)
27
28print: $(PSFILES)
29 $(LPR) $(PSFILES)
30
31%.dvi: %.sgml
32 $(SGML2DVI) $<
33
34%.dvi: %.tex
35 @set -e; pass=2; echo "Running LaTeX $<"; \
36 while [ `$(LATEX) $< </dev/null 2>&1 | \
37 grep -c '^\(LaTeX Warning: Label(s) may\|No file \|! Emergency stop\)'` -ge 1 ]; do \
38 if [ $$pass -gt 3 ]; then \
39 echo "Seems, something is wrong. Try by hands." ; exit 1 ; \
40 fi; \
41 echo "Re-running LaTeX $<, $${pass}d pass"; pass=$$[$$pass + 1]; \
42 done
43
44%.ps: %.dvi
osdl.net!shemmingerb7a346b2005-03-10 19:01:36 +000045 $(DVIPS) $< -o $@
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000046
47%.html: %.sgml
48 $(SGML2HTML) $<
49
50install:
51 install -m 0644 $(shell echo *.tex) $(DESTDIR)$(DOCDIR)
52 install -m 0644 $(shell echo *.sgml) $(DESTDIR)$(DOCDIR)
53
54clean:
55 rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html