summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/disser/templates/latex.mk
blob: 1add498387bee65b39ad6c75971ce5d905d3d0dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
# Makefile for LaTeX projects
# Author: Stanislav Kruchinin <stas@crypt.org.ru>
#

TARGET=thesis

TEX=latex
BIBTEX=bibtex8
PDFLATEX=pdflatex
L2H=latex2html
FIND=/bin/find

TEXFLAGS=-src-specials
BIBTEXFLAGS=-B -c cp1251
L2HFLAGS=-dir html -iso_language RU.RU -split 3 -short_index \
         -numbered_footnotes -no_footnode -white -antialias \
         -html_version 4.0 

SRC=$(TARGET).tex

# Files to remove.
CLEANEXT=*.aux *.toc *.idx *.ind *.ilg *.log *.out *.lof *.lot *.lol \
  *.bbl *.blg *.bak *.dvi 
CLEANFILES=$(TARGET).pdf $(TARGET).ps $(TARGET)_2on1.ps $(TARGET)_2on1.pdf \
  $(TARGET).tar.bz2

# Targets 
dvi: $(TARGET).dvi

ps: $(TARGET).ps

pdf: $(TARGET).pdf

html: $(SRC)
	$(TEX) $(TARGET).tex
	$(BIBTEX) $(BIBTEXFLAGS) $(TARGET) ;\
	$(TEX) $(TARGET).tex
	$(L2H) $(L2HFLAGS) $(TARGET).tex

ps_2on1: $(TARGET)_2on1.ps

pdf_2on1: $(TARGET)_2on1.pdf

help:
	@echo "run: make or make dvi or make $(TARGET).dvi"
	@echo "run: make ps or make $(TARGET).ps"
	@echo "run: make pdf or make $(TARGET).pdf"
	@echo "run: make html"
	@echo "run: make ps_2on1 or make $(TARGET)_2on1.ps"
	@echo "run: make pdf_2on1 or make $(TARGET)_2on1.pdf"
	@echo "run: make srcdist to create archive $(TARGET).tar.bz2"
	@echo "run: make clean to remove (pdf)TeX ouptut files"
	@echo "run: make cleansvn to \"make clean\" and remove .svn directories"

$(TARGET).dvi: $(SRC)
	$(TEX) $(TEXFLAGS) $(TARGET).tex
	$(BIBTEX) $(BIBTEXFLAGS) $(TARGET) ;\
	$(TEX) $(TEXFLAGS) $(TARGET).tex
	counter=3 ; \
	while egrep -s 'Rerun (LaTeX|to get)' $(TARGET).log && [ $$counter -gt 0 ] ;\
	do \
  		$(TEX) $(TEXFLAGS) $(TARGET).tex ;\
    	counter=`expr $$counter - 1` ;\
	done

$(TARGET).ps: $(TARGET).dvi
	dvips -o $(TARGET).ps $(TARGET).dvi

$(TARGET).pdf: $(SRC)
	@$(MAKE) -C fig fixbb pdf
	$(PDFLATEX) $(TARGET).tex
	$(BIBTEX) $(BIBTEXFLAGS) $(TARGET) ;\
	$(PDFLATEX) $(TARGET).tex
	counter=3 ; \
	while egrep -s 'Rerun (LaTeX|to get)' $(TARGET).log && [ $$counter -gt 0 ] ;\
	do \
  		$(PDFLATEX) $(TARGET).tex ;\
		counter=`expr $$counter - 1` ;\
	done

$(TARGET)_2on1.ps: $(TARGET).ps
	psnup -2 $^ > $@

$(TARGET)_2on1.pdf: $(TARGET)_2on1.ps
	ps2pdf $^ $@

fixbb: fig/*.eps
	@$(MAKE) -C fig fixbb

srcdist:
	@$(MAKE) clean
	tar cjvf $(TARGET).tar.bz2 .

clean:
	rm -f $(CLEANEXT) $(CLEANFILES)
	rm -f html/*\.*
	@$(MAKE) -C fig clean

cleansvn:
	@$(MAKE) clean
	$(FIND) . -name ".svn" -exec rm -Rf \{\} \;