-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMAKEFILE
78 lines (63 loc) · 2.2 KB
/
MAKEFILE
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
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Descr: Vorlage für Berichte der HKA, Abkürzungen
# %% Author: Jonas Höfflin, [email protected]
# %% -*- coding: utf-8 -*-
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Dateiname der Haupt-Datei
BASE = bericht
LATEX = pdflatex -file-line-error
BIBTEX = bibtex
MAKEINDEX = makeindex -s $(BASE).ist
# Wo werden die diversen Dateien gesucht:
# Ein // am Ende bedeutet: in allen Unterverzeichnissen
# BIBTEX-Style Files (*.bst)
export BSTINPUTS := .//:$(BSTINPUTS)
# BIBTEX Datenbank(en) (*.bib)
export BIBINPUTS := .//:$(BIBINPUTS)
# LaTeX Styles und Klassen (*.sty, *.cls)
export TEXINPUTS := .//:$(TEXINPUTS)
all: $(BASE).pdf
$(BASE).pdf: *.tex *.bib Makefile.
$(MAKE) clean
$(LATEX) $(BASE).tex
- grep -q "Warning: Citation " $*.log && $(BIBTEX) $(BASE)
- [ -f $(BASE).idx ] && $(MAKEINDEX) $(BASE)
$(LATEX) $(BASE).tex
- grep -q "Warning: Citation " $*.log && $(BIBTEX) $(BASE)
- [ -f $(BASE).idx ] && $(MAKEINDEX) $(BASE)
$(BIBTEX) $(BASE)
$(LATEX) $(BASE).tex
pdf:
$(LATEX) $(BASE)
index:
$(MAKEINDEX) $(BASE)
bib:
$(BIBTEX) $(BASE)
# Nur Fehlermeldungen ausgeben
check: $(BASE).pdf
@echo; echo "*******************************"; echo; echo;
$(LATEX) -interaction=nonstopmode $(BASE).tex 2>&1 | egrep "LaTeX Warning"; \
if [ $$? -ne 0 ]; then exit 0; else exit 1; fi
# Die Datei "Makefile." muss unter Linux existieren, da ProTexT (Windows)
# einen Bug hat, der verhindert, dass eine Datei ohne einen Punkt mittels
# des listings-Paketets inkludiert werden kann. (Siehe "kapitel2.tex")
Makefile. : Makefile
ln -s Makefile Makefile.
# Hilfsdateien loeschen
clean:
rm -f *.toc *.dvi *.aux *.log *.blg *.bbl *.out *.for \
*.lof *.lol *.lot *.bcf *.run.xml *-blx.bib *.idx \
*.ind *.ilg *.blg *.tdo \
*~
# Wirklich alles loeschen
realclean: clean
rm -f $(BASE).pdf
# Erstelle tar-Archiv des ganzen Verzeichnisses
tar: $(BASE).pdf
$(MAKE) clean
D=`pwd`; D=`basename $$D`; \
cd ..; \
tar --exclude "*.tar.gz" --exclude RCS \
--exclude Pakete \
--dereference \
-czvf $$D/vorlage-`date "+%Y-%m-%d"`.tar.gz $$D