-
-
Notifications
You must be signed in to change notification settings - Fork 109
/
makefile
74 lines (59 loc) · 1.54 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
TEX = xelatex
BIB = bibtex
MKI = makeindex
MAIN = yanputhesis
TEXARGS = -synctex=1 -shell-escape
main: close wipe clean makecls open
sample: close wipesample clean texsample opensample
samplebib: close wipesample clean texsamplebib opensample
makecls: $(MAIN).dtx
$(TEX) $<
./zhmakeindex -s gglo.ist -o $(MAIN).gls $(MAIN).glo
$(MKI) -s gind.ist -o $(MAIN).ind $(MAIN).idx
$(TEX) $<
$(TEX) $<
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)-sample.tex
$(TEX) $(TEXARGS) $<
$(MKI) $(MAIN)-sample.nlo -s nomencl.ist -o $(MAIN)-sample.nls
$(TEX) $(TEXARGS) $<
texsamplebib: $(MAIN)-sample.tex
$(TEX) $(TEXARGS) $<
$(BIB) $(MAIN)-sample.aux
$(MKI) $(MAIN)-sample.nlo -s nomencl.ist -o $(MAIN)-sample.nls
$(TEX) $(TEXARGS) $<
$(TEX) $(TEXARGS) $<
open: $(MAIN).pdf
$(OPEN) $(MAIN).pdf
opensample: $(MAIN)-sample.pdf
$(OPEN) $(MAIN)-sample.pdf
close:
@$(CLOSE) || echo not found
clean:
$(RM) *.gls *.glo *.ind yanputhesis.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