forked from hithesis/hithesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (49 loc) · 1.24 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
# Makefile for hithesis
METHOD = xelatex
# Set opts for latexmk if you use it
LATEXMKOPTS = -xelatex
# Basename of thesis
PACKAGE=hithesis
VERSION=`grep -m 1 -o "v[0-9]\+\.[0-9]\+\.[0-9]\+" $(PACKAGE).dtx`
SOURCES=$(PACKAGE).ins $(PACKAGE).dtx
TARGETS=dtx-style.sty
# make deletion work on Windows
ifdef SystemRoot
RM = del /Q
OPEN = start
else
RM = rm -f
OPEN = open
endif
.PHONY: all cls doc viewdoc dist auxclean clean distclean
all: doc
cls: $(TARGETS)
$(TARGETS): $(SOURCES)
latex $(PACKAGE).ins
doc: $(PACKAGE).pdf
viewdoc: doc
$(OPEN) $(PACKAGE).pdf
ifeq ($(METHOD),latexmk)
$(PACKAGE).pdf: $(TARGETS)
$(METHOD) $(LATEXMKOPTS) $(PACKAGE).dtx
else ifeq ($(METHOD),xelatex)
$(PACKAGE).pdf: $(TARGETS)
$(METHOD) $(PACKAGE).dtx
makeindex -s gind.ist -o $(PACKAGE).ind $(PACKAGE).idx
makeindex -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo
$(METHOD) $(PACKAGE).dtx
$(METHOD) $(PACKAGE).dtx
else
$(error Unknown METHOD: $(METHOD))
endif
dist: all
-$(RM) $(PACKAGE)-$(VERSION).zip
zip -r $(PACKAGE)-$(VERSION).zip examples/ $(PACKAGE).pdf
auxclean:
latexmk -c $(PACKAGE).dtx
-$(RM) *.glo *.gls *.hd
clean: auxclean
-$(RM) *.bst *.ist *.cls *.cfg *.sty *.eps
-$(RM) $(PACKAGE).pdf
distclean: clean
-$(RM) $(PACKAGE)-$(VERSION).zip