]>
Commit | Line | Data |
---|---|---|
5f4d27d5 | 1 | PSFILES=ip-cref.ps ip-tunnels.ps api-ip6-flowlabels.ps ss.ps nstat.ps arpd.ps rtstat.ps tc-filters.ps |
aba5acdf SH |
2 | # tc-cref.ps |
3 | # api-rtnl.tex api-pmtudisc.tex api-news.tex | |
4 | # iki-netdev.ps iki-neighdst.ps | |
5 | ||
6 | ||
7 | LATEX=latex | |
8 | DVIPS=dvips | |
0ecf26fc | 9 | SGML2DVI=sgml2latex |
aba5acdf SH |
10 | SGML2HTML=sgml2html -s 0 |
11 | LPR=lpr -Zsduplex | |
12 | SHELL=bash | |
13 | PAGESIZE=a4 | |
14 | PAGESPERPAGE=2 | |
15 | ||
16 | HTMLFILES=$(subst .sgml,.html,$(shell echo *.sgml)) | |
17 | DVIFILES=$(subst .ps,.dvi,$(PSFILES)) | |
27b3f524 | 18 | PDFFILES=$(subst .ps,.pdf,$(PSFILES)) |
aba5acdf SH |
19 | |
20 | ||
21 | all: pstwocol | |
22 | ||
23 | pstwocol: $(PSFILES) | |
24 | ||
25 | html: $(HTMLFILES) | |
26 | ||
27 | dvi: $(DVIFILES) | |
28 | ||
27b3f524 BP |
29 | pdf: $(PDFFILES) |
30 | ||
aba5acdf SH |
31 | print: $(PSFILES) |
32 | $(LPR) $(PSFILES) | |
33 | ||
0ecf26fc WF |
34 | %.tex: %.sgml |
35 | $(SGML2DVI) --output=tex $< | |
36 | ||
aba5acdf | 37 | %.dvi: %.sgml |
0ecf26fc | 38 | $(SGML2DVI) --output=dvi $< |
aba5acdf SH |
39 | |
40 | %.dvi: %.tex | |
41 | @set -e; pass=2; echo "Running LaTeX $<"; \ | |
42 | while [ `$(LATEX) $< </dev/null 2>&1 | \ | |
43 | grep -c '^\(LaTeX Warning: Label(s) may\|No file \|! Emergency stop\)'` -ge 1 ]; do \ | |
44 | if [ $$pass -gt 3 ]; then \ | |
45 | echo "Seems, something is wrong. Try by hands." ; exit 1 ; \ | |
46 | fi; \ | |
47 | echo "Re-running LaTeX $<, $${pass}d pass"; pass=$$[$$pass + 1]; \ | |
48 | done | |
49 | ||
0ecf26fc WF |
50 | %.pdf: %.tex |
51 | @set -e; pass=2; echo "Running pdfLaTeX $<"; \ | |
52 | while [ `pdflatex $< </dev/null 2>&1 | \ | |
53 | grep -c '^\(LaTeX Warning: Label(s) may\|No file \|! Emergency stop\)'` -ge 1 ]; do \ | |
54 | if [ $$pass -gt 3 ]; then \ | |
55 | echo "Seems, something is wrong. Try by hands." ; exit 1 ; \ | |
56 | fi; \ | |
57 | echo "Re-running pdfLaTeX $<, $${pass}d pass"; pass=$$[$$pass + 1]; \ | |
58 | done | |
59 | #%.pdf: %.ps | |
60 | # ps2pdf $< | |
27b3f524 | 61 | |
aba5acdf | 62 | %.ps: %.dvi |
b7a346be | 63 | $(DVIPS) $< -o $@ |
aba5acdf SH |
64 | |
65 | %.html: %.sgml | |
66 | $(SGML2HTML) $< | |
67 | ||
68 | install: | |
69 | install -m 0644 $(shell echo *.tex) $(DESTDIR)$(DOCDIR) | |
70 | install -m 0644 $(shell echo *.sgml) $(DESTDIR)$(DOCDIR) | |
71 | ||
72 | clean: | |
2dc6731d | 73 | rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html *.pdf |