-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
58 lines (41 loc) · 1.4 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
INS = beamercolorthemeowl.ins
PACKAGE_SRC = beamercolorthemeowl.dtx
PACKAGE_STY = beamercolorthemeowl.sty
DOC_SRC = beamercolorthemeowl.dtx
DOC_PDF = beamercolorthemeowl.pdf
DESTDIR ?= $(shell kpsewhich -var-value=TEXMFHOME)
INSTALL_DIR = $(DESTDIR)/tex/latex/beamercolorthemeowl
DOC_DIR = $(DESTDIR)/doc/latex/beamercolorthemeowl
CACHE_DIR := .latex-cache
COMPILE_TEX := latexmk -pdf -output-directory=$(CACHE_DIR)
.PHONY: all sty doc install uninstall clean clean-cache clean-sty ctan
all: sty doc
sty: $(PACKAGE_STY)
doc: $(DOC_PDF)
demo: $(DEMO_PDF)
clean: clean-cache clean-sty
ctan: clean
@find . -name '*.DS_Store' -type f -delete
zip -r beamercolorthemeowl.zip * -x *.git*
install: $(PACKAGE_STY) $(DOC_PDF)
@mkdir -p $(INSTALL_DIR)
@cp $(PACKAGE_STY) $(INSTALL_DIR)
@mkdir -p $(DOC_DIR)
@cp $(DOC_PDF) $(DOC_DIR)
uninstall:
@rm -f $(addprefix $(INSTALL_DIR)/, $(PACKAGE_STY))
@rmdir $(INSTALL_DIR)
@rm -f $(DOC_DIR)/$(notdir $(DOC_PDF))
@rmdir $(DOC_DIR)
clean-cache:
@rm -Rf $(CACHE_DIR)
clean-sty:
@rm -f $(PACKAGE_STY)
$(CACHE_DIR):
@mkdir -p $(CACHE_DIR)
$(PACKAGE_STY): $(PACKAGE_SRC) $(INS) | clean-cache $(CACHE_DIR)
@cd $(dir $(INS)) && latex -output-directory=$(CACHE_DIR) $(notdir $(INS))
@cp $(addprefix $(CACHE_DIR)/,$(PACKAGE_STY)) .
$(DOC_PDF): %.pdf: %.dtx $(PACKAGE_STY) | clean-cache $(CACHE_DIR)
$(COMPILE_TEX) $<
@cp $(CACHE_DIR)/$(notdir $@) $@