-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
88 lines (70 loc) · 2.06 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
79
80
81
82
83
84
85
86
87
88
REPORT = paper
LATEX = pdflatex
BIBTEX = bibtex -min-crossrefs=100
REF = ref
TEX = $(wildcard *.tex)
SRCS = $(TEX)
FMT = cmds.tex hdr.tex fmt.tex
REFS = macro.bib $(REF).bib
OPTS = -interation=nonstopmode -quiet -halt-on-error
UNAME = $(shell uname -s)
QUITE = false
ifeq ($(UNAME), Linux)
VIEWER = evince
endif
ifeq ($(UNAME), Darwin)
VIEWER = open
endif
ifeq ($(OS),Windows_NT)
VIEWER = $(shell echo "Yolo does not support stupid Windows ^.^ >> file: ")
endif
ifeq ($(QUITE), true)
SUFFIX = 1>/dev/null
else
SUFFIX = ""
endif
ifneq ("$(wildcard $(REPORT).bbl)","")
all: fast
else
all: loud
endif
.PHONY: fast loud quite bib spell
f: $(SRCS) $(REFS)
@echo ================== YOLO: running full build ==================
@TEXINPUTS="sty:" $(LATEX) $(REPORT) $(OPTS) $(SUFFIX)
$(BIBTEX) $(REPORT)
perl -pi -e "s/%\s+//" $(REPORT).bbl
@TEXINPUTS="sty:" $(LATEX) $(REPORT) $(OPTS) $(SUFFIX)
@TEXINPUTS="sty:" $(LATEX) $(REPORT) $(OPTS) $(SUFFIX)
fast: $(SRCS) $(REFS)
@echo ================== YOLO: running fast build ==================
@TEXINPUTS="sty:" $(LATEX) $(REPORT) $(OPTS) $(SUFFIX)
loud: $(SRCS) $(REFS)
@echo ================== YOLO: running full build ==================
@TEXINPUTS="sty:" $(LATEX) $(OPTS) $(REPORT) $(SUFFIX)
$(BIBTEX) $(REPORT)
perl -pi -e "s/%\s+//" $(REPORT).bbl
@TEXINPUTS="sty:" $(LATEX) $(OPTS) $(REPORT) $(SUFFIX)
@TEXINPUTS="sty:" $(LATEX) $(OPTS) $(REPORT) $(SUFFIX)
quite: $(SRCS) $(REFS)
@echo ================== YOLO: running full build quitely ==================
@TEXINPUTS="sty:" $(LATEX) $(REPORT) $(OPTS) 1>/dev/null
$(BIBTEX) $(REPORT)
perl -pi -e "s/%\s+//" $(REPORT).bbl
@TEXINPUTS="sty:" $(LATEX) $(REPORT) $(OPTS) 1>/dev/null
@TEXINPUTS="sty:" $(LATEX) $(REPORT) $(OPTS) 1>/dev/null
spell:
make clean
for i in $(filter-out $(FMT), $(SRCS)); do ispell $$i; done
bib: $(BIBTEX) $(REPORT)
perl -pi -e "s/%\s+//" $(REPORT).bbl
l: loud
full: loud
pdf: loud
q: quite
tidy:
rm -f *~ *.dvi *.aux *.log *.blg *.bbl $(REPORT).ps *.out *.bcf *.soc
clean: tidy
rm -f $(REPORT).pdf
view: all
$(VIEWER) $(REPORT).pdf