osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 1 | PSFILES=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 | |
| 7 | LATEX=latex |
| 8 | DVIPS=dvips |
| 9 | SGML2DVI=sgml2latex --output=dvi |
| 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)) |
Brandon Philips | 27b3f52 | 2011-03-25 14:43:44 -0700 | [diff] [blame^] | 18 | PDFFILES=$(subst .ps,.pdf,$(PSFILES)) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 19 | |
| 20 | |
| 21 | all: pstwocol |
| 22 | |
| 23 | pstwocol: $(PSFILES) |
| 24 | |
| 25 | html: $(HTMLFILES) |
| 26 | |
| 27 | dvi: $(DVIFILES) |
| 28 | |
Brandon Philips | 27b3f52 | 2011-03-25 14:43:44 -0700 | [diff] [blame^] | 29 | pdf: $(PDFFILES) |
| 30 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 31 | print: $(PSFILES) |
| 32 | $(LPR) $(PSFILES) |
| 33 | |
| 34 | %.dvi: %.sgml |
| 35 | $(SGML2DVI) $< |
| 36 | |
| 37 | %.dvi: %.tex |
| 38 | @set -e; pass=2; echo "Running LaTeX $<"; \ |
| 39 | while [ `$(LATEX) $< </dev/null 2>&1 | \ |
| 40 | grep -c '^\(LaTeX Warning: Label(s) may\|No file \|! Emergency stop\)'` -ge 1 ]; do \ |
| 41 | if [ $$pass -gt 3 ]; then \ |
| 42 | echo "Seems, something is wrong. Try by hands." ; exit 1 ; \ |
| 43 | fi; \ |
| 44 | echo "Re-running LaTeX $<, $${pass}d pass"; pass=$$[$$pass + 1]; \ |
| 45 | done |
| 46 | |
Brandon Philips | 27b3f52 | 2011-03-25 14:43:44 -0700 | [diff] [blame^] | 47 | #%.pdf: %.tex |
| 48 | # pdflatex $< |
| 49 | %.pdf: %.ps |
| 50 | ps2pdf $< |
| 51 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 52 | %.ps: %.dvi |
osdl.net!shemminger | b7a346b | 2005-03-10 19:01:36 +0000 | [diff] [blame] | 53 | $(DVIPS) $< -o $@ |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 54 | |
| 55 | %.html: %.sgml |
| 56 | $(SGML2HTML) $< |
| 57 | |
| 58 | install: |
| 59 | install -m 0644 $(shell echo *.tex) $(DESTDIR)$(DOCDIR) |
| 60 | install -m 0644 $(shell echo *.sgml) $(DESTDIR)$(DOCDIR) |
| 61 | |
| 62 | clean: |
| 63 | rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html |