-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
62 lines (49 loc) · 1.13 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
TEX = xelatex
BIB = bibtex
MKI = makeindex
MAIN = example
TEXARGS = -synctex=1 -shell-escape
sample: close wipesample clean texsamplebib opensample
ifeq ($(OS), Windows_NT)
PLATFORM = Windows
else
ifeq ($(shell uname), Darwin)
PLATFORM = MacOS
else
PLATFORM = Unix-Like
endif
endif
ifeq ($(PLATFORM), Windows)
RM = del /s /f
OPEN = cmd /c start
CLOSE = cmd /c taskkill /im Acrobat.exe /t /f
else
RM = rm -rf
OPEN = open
PID = $$(ps -ef | grep AdobeAcrobat | grep -v grep | awk '{print $$2}')
CLOSE = kill -9 $(PID)
endif
texsample: $(MAIN).tex
$(TEX) $(TEXARGS) $<
$(TEX) $(TEXARGS) $<
texsamplebib: $(MAIN).tex
$(TEX) $(TEXARGS) $<
$(BIB) $(MAIN).aux
$(TEX) $(TEXARGS) $<
$(TEX) $(TEXARGS) $<
open: $(MAIN).pdf
$(OPEN) $(MAIN).pdf
opensample: $(MAIN).pdf
$(OPEN) $(MAIN).pdf
close:
@$(CLOSE) || echo not found
clean:
$(RM) *.gls *.glo *.ind *.idx
$(RM) *.ilg *.aux *.toc *.aux
$(RM) *.hd *.out *.thm *.gz *.nlo *.nls
$(RM) *.log *.lof *.lot *.bbl *.blg
wipe:
$(RM) $(MAIN).pdf
wipesample:
$(RM) $(MAIN)-sample.pdf
.PHONY: open close clean wipe