blob: 3bfcdc2b4fc854b8039f85b6fb2097a525c12646 [file] [log] [blame]
Stephen Hemmingera4cda982017-09-29 10:06:50 -07001PSFILES=ip-cref.ps
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +00002
3LATEX=latex
4DVIPS=dvips
Werner Fink0ecf26f2012-09-24 12:50:37 -07005SGML2DVI=sgml2latex
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +00006SGML2HTML=sgml2html -s 0
7LPR=lpr -Zsduplex
8SHELL=bash
9PAGESIZE=a4
10PAGESPERPAGE=2
11
12HTMLFILES=$(subst .sgml,.html,$(shell echo *.sgml))
13DVIFILES=$(subst .ps,.dvi,$(PSFILES))
Brandon Philips27b3f522011-03-25 14:43:44 -070014PDFFILES=$(subst .ps,.pdf,$(PSFILES))
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000015
16
17all: pstwocol
18
19pstwocol: $(PSFILES)
20
21html: $(HTMLFILES)
22
23dvi: $(DVIFILES)
24
Brandon Philips27b3f522011-03-25 14:43:44 -070025pdf: $(PDFFILES)
26
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000027print: $(PSFILES)
28 $(LPR) $(PSFILES)
29
Werner Fink0ecf26f2012-09-24 12:50:37 -070030%.tex: %.sgml
31 $(SGML2DVI) --output=tex $<
32
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000033%.dvi: %.sgml
Werner Fink0ecf26f2012-09-24 12:50:37 -070034 $(SGML2DVI) --output=dvi $<
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000035
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 Fink0ecf26f2012-09-24 12:50:37 -070046%.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 Philips27b3f522011-03-25 14:43:44 -070057
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000058%.ps: %.dvi
osdl.net!shemmingerb7a346b2005-03-10 19:01:36 +000059 $(DVIPS) $< -o $@
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000060
61%.html: %.sgml
62 $(SGML2HTML) $<
63
64install:
65 install -m 0644 $(shell echo *.tex) $(DESTDIR)$(DOCDIR)
66 install -m 0644 $(shell echo *.sgml) $(DESTDIR)$(DOCDIR)
67
68clean:
vadimk2dc67312014-10-26 11:52:03 +020069 rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html *.pdf