-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (28 loc) · 1.08 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
PROJECT = room
SUBFOLDER = Combinatorics/Room\ Squares
VERSION = 1.1.0
FINAL_INPUT = src/$(PROJECT).tex src/*.tex
FINAL_OUTDIR = ${RELEASE_BUILD_FOLDER}/$(SUBFOLDER)
FINAL_OUTPUT = $(FINAL_OUTDIR)/$(PROJECT).pdf
DRAFT_INPUT = src/$(PROJECT)-draft.tex src/*.tex
DRAFT_OUTDIR = ${DRAFT_BUILD_FOLDER}/$(SUBFOLDER)
DRAFT_OUTPUT = $(DRAFT_OUTDIR)/$(PROJECT)-draft.pdf
.PHONY: all draft pdf watch clean
all: draft
draft: $(DRAFT_OUTPUT)
pdf: $(FINAL_OUTPUT)
clean: $(DRAFT_INPUT)
latexmk -c -cd -outdir=$(DRAFT_OUTDIR) -xelatex $<
$(FINAL_OUTPUT): $(FINAL_INPUT)
latexmk -cd -outdir=$(FINAL_OUTDIR) -jobname=%A-v$(VERSION) -xelatex $<;
latexmk -c -cd -outdir=$(FINAL_OUTDIR) -jobname=%A-v$(VERSION) -xelatex $<
$(DRAFT_OUTPUT): $(DRAFT_INPUT)
latexmk -cd -outdir=$(DRAFT_OUTDIR) -xelatex $<;
latexmk -c -cd -outdir=$(DRAFT_OUTDIR) -xelatex $<
watch: $(DRAFT_INPUT)
latexmk -cd -outdir=$(DRAFT_OUTDIR) -pvc -xelatex $<
hooks:
find .git/hooks -type l -exec rm {} \; && find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;
.git/hooks/post-commit \;
count:
wc src/main/*.tex > wc.txt