-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (49 loc) · 1.68 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
DOC ?= draft
PAPERSROOT = .
MAKEDIR = $(PAPERSROOT)/make
BIBFILE = bibliography.bib
TARGETS = make $(DOC).pdf
sinclude $(MAKEDIR)/commondefs
export TEXINPUTS = acmart:syntax:sty:tex-macros:sections:
# Included figures (usually .pdf files)
FIGS = $(wildcard figures/*)
CODEFIGS = $(wildcard figures/*.code)
ACMART = acmart/acmart.cls acmart/ACM-Reference-Format.bst
TEXDIRS = $(subst :, ,$(TEXINPUTS))
SUBDIRTEXS = $(foreach DIR,$(TEXDIRS),$(wildcard $(DIR)/*.sty $(DIR)/*.tex))
TEXS = $(DOC).tex paper.tex header.tex body.tex $(wildcard *.sty) $(SUBDIRTEXS) \
$(CODEFIGS:.code=.code.tex) \
$(ACMART)
default: $(TARGETS)
.PHONY: default
SUBMODULES = make acmart
# add more submodules here, e.g., tex-macros, bibtex
$(DOC).pdf: $(TEXS) $(FIGS) $(DOC).stamp $(SUBMODULES) $(DOC).bbl $(BIBFILE)
$(DOC).bbl: $(BIBFILE) $(DOC).stamp
$(DOC).tex:
printf '\\newcommand{\\paperversion}{${DOC}}\n\\input{paper}' > $@
$(DOC)-archive.tex: $(DOC).pdf
latexpand $(DOC).tex > $@
$(DOC)-archive.zip: $(ACMART) $(DOC)-archive.tex
zip $@ $^ $(DOC).bbl
$(SUBMODULES):
$(MAKE) submodules
@echo "Run make again!"
submodules:
git submodule update --init --recursive
.PHONY: submodules
$(ACMART): acmart
$(MAKE) -C acmart $(notdir $@)
debug:
@echo "TARGETS = $(TARGETS)"
@echo "TEXS = $(TEXS)"
@echo "FIGS = $(FIGS)"
.PHONY: debug
figures/%.code.tex: figures/%.code texify-code.pl
perl texify-code.pl $< > $@
LDIRT = local.* draft.* submission.* final.* \
finaldraft.* tr.* trdraft.* blindtr.* web.* \
*-archive.* \
figures/*.code.tex *.fdb_latexmk *.fls *.cut *.up*
include $(COMMONRULES)
print-% : ; @echo $* = $($*)