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