-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (57 loc) · 1.64 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
# filename of base file
BASE = bericht
LATEX = pdflatex -file-line-error
BIBTEX = biber
MAKEINDEX = makeindex -s $(BASE).ist
# BIBTEX-Style files (*.bst)
export BSTINPUTS := .//:$(BSTINPUTS)
# BIBTEX databases (*.bib)
export BIBINPUTS := .//:$(BIBINPUTS)
# LaTeX styles and classes (*.sty, *.cls)
export TEXINPUTS := .//:$(TEXINPUTS)
# determine remove command for OS
ifdef OS
RM = del /Q /f /s
else
RM = rm -f
endif
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)
# print only error messages
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
# remove build files
clean:
$(RM) *.toc *.dvi *.aux *.log *.blg *.bbl *.out *.for \
*.lof *.lol *.lot *.bcf *.run.xml *-blx.bib *.idx \
*.ind *.ilg *.blg *.tdo \
*~
# the other one just pretended to clean, this does for sure
realclean: clean
$(RM) $(BASE).pdf
# create tar archive of project
tar: $(BASE).pdf
$(MAKE) clean
D=`pwd`; D=`basename $$D`; \
cd ..; \
tar --exclude "*.tar.gz" --exclude RCS \
--exclude Pakete \
--dereference \
-czvf $$D/latex-vorlage-`date "+%Y-%m-%d"`.tar.gz $$D