blob: 0c51872afac5a15b106bede6d79c116f45a09dbc [file] [log] [blame]
Phil Sutter5f4d27d2016-03-04 13:11:47 +01001PSFILES=ip-cref.ps ip-tunnels.ps api-ip6-flowlabels.ps ss.ps nstat.ps arpd.ps rtstat.ps tc-filters.ps
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +00002# 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
Werner Fink0ecf26f2012-09-24 12:50:37 -07009SGML2DVI=sgml2latex
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000010SGML2HTML=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))
Brandon Philips27b3f522011-03-25 14:43:44 -070018PDFFILES=$(subst .ps,.pdf,$(PSFILES))
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000019
20
21all: pstwocol
22
23pstwocol: $(PSFILES)
24
25html: $(HTMLFILES)
26
27dvi: $(DVIFILES)
28
Brandon Philips27b3f522011-03-25 14:43:44 -070029pdf: $(PDFFILES)
30
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000031print: $(PSFILES)
32 $(LPR) $(PSFILES)
33
Werner Fink0ecf26f2012-09-24 12:50:37 -070034%.tex: %.sgml
35 $(SGML2DVI) --output=tex $<
36
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000037%.dvi: %.sgml
Werner Fink0ecf26f2012-09-24 12:50:37 -070038 $(SGML2DVI) --output=dvi $<
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000039
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
Werner Fink0ecf26f2012-09-24 12:50:37 -070050%.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 $<
Brandon Philips27b3f522011-03-25 14:43:44 -070061
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000062%.ps: %.dvi
osdl.net!shemmingerb7a346b2005-03-10 19:01:36 +000063 $(DVIPS) $< -o $@
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000064
65%.html: %.sgml
66 $(SGML2HTML) $<
67
68install:
69 install -m 0644 $(shell echo *.tex) $(DESTDIR)$(DOCDIR)
70 install -m 0644 $(shell echo *.sgml) $(DESTDIR)$(DOCDIR)
71
72clean:
vadimk2dc67312014-10-26 11:52:03 +020073 rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html *.pdf