Home | History | Annotate | Download | only in doc
      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))
     18 PDFFILES=$(subst .ps,.pdf,$(PSFILES))
     19 
     20 
     21 all: pstwocol
     22 
     23 pstwocol: $(PSFILES)
     24 
     25 html: $(HTMLFILES)
     26 
     27 dvi: $(DVIFILES)
     28 
     29 pdf: $(PDFFILES)
     30 
     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 
     47 #%.pdf: %.tex
     48 #	pdflatex $<
     49 %.pdf: %.ps
     50 	ps2pdf $<
     51 
     52 %.ps: %.dvi
     53 	$(DVIPS) $< -o $@
     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
     64