Phil Sutter | 5f4d27d | 2016-03-04 13:11:47 +0100 | [diff] [blame] | 1 | PSFILES=ip-cref.ps ip-tunnels.ps api-ip6-flowlabels.ps ss.ps nstat.ps arpd.ps rtstat.ps tc-filters.ps |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 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 |
Werner Fink | 0ecf26f | 2012-09-24 12:50:37 -0700 | [diff] [blame] | 9 | SGML2DVI=sgml2latex |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 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 | |
Werner Fink | 0ecf26f | 2012-09-24 12:50:37 -0700 | [diff] [blame] | 34 | %.tex: %.sgml |
| 35 | $(SGML2DVI) --output=tex $< |
| 36 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 37 | %.dvi: %.sgml |
Werner Fink | 0ecf26f | 2012-09-24 12:50:37 -0700 | [diff] [blame] | 38 | $(SGML2DVI) --output=dvi $< |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 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 | |
Werner Fink | 0ecf26f | 2012-09-24 12:50:37 -0700 | [diff] [blame] | 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 $< |
Brandon Philips | 27b3f52 | 2011-03-25 14:43:44 -0700 | [diff] [blame] | 61 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 62 | %.ps: %.dvi |
osdl.net!shemminger | b7a346b | 2005-03-10 19:01:36 +0000 | [diff] [blame] | 63 | $(DVIPS) $< -o $@ |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 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: |
vadimk | 2dc6731 | 2014-10-26 11:52:03 +0200 | [diff] [blame] | 73 | rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html *.pdf |