forked from ashee/cv
-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
63 lines (51 loc) · 1.79 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
# A Simple Makefile for LaTeX
# Author: Lester James V. Miranda
# E-mail: [email protected]
# Modified by Jesper Dramsch
.DEFAULT_GOAL := default
# Default variables which can be edited via the terminal
comma := ,
BUILDDIR = _build
COMPILER = xelatex
BIBCOMPILER = biber
BIBLIOGRAPHY = bibliography
pdf: headon clean
@echo "Building $(PROJECT) in $(BUILDDIR) directory using $(COMPILER)."
@echo "Creating $(BUILDDIR) directory..."
@mkdir -p $(BUILDDIR)
@$(COMPILER) -interaction=nonstopmode -halt-on-error -output-directory=$(BUILDDIR) $(PROJECT).tex
@echo "First pass (via $(COMPILER)) done!"
ifeq ($(PROJECT), "cv")
@cp $(BIBLIOGRAPHY).bib $(BUILDDIR)
@$(BIBCOMPILER) --output_directory=$(BUILDDIR) $(PROJECT)
@echo "Second pass (via $(BIBCOMPILER)) done!"
endif
@$(COMPILER) -interaction=nonstopmode -halt-on-error -output-directory=$(BUILDDIR) $(PROJECT).tex
@echo "Third pass (via $(COMPILER)) done!"
@$(COMPILER) -interaction=nonstopmode -halt-on-error -output-directory=$(BUILDDIR) $(PROJECT).tex
@echo "Last pass (via $(COMPILER)) done!"
@cp $(BUILDDIR)/$(PROJECT).pdf $(PROJECT)-$(subst $(comma),-,$(strip $(DOCOPTIONS))).pdf
@echo "Compilation done. Output file is $(PROJECT)-$(subst $(comma),-,$(strip $(DOCOPTIONS))).pdf"
headon:
ifneq ($(OPTIN),)
@$(eval DOCOPTIONS:=$(DOCOPTIONS),$(OPTIN))
endif
@echo "\documentclass[$(DOCOPTIONS)]{friggeri-cv}" > .head
a4pdf:
$(MAKE) headon OPTIN=a4pdf
$(MAKE) default DOCOPTIONS=$(DOCOPTIONS),a4pdf
nocolors:
$(MAKE) headon OPTIN=nocolors
$(MAKE) default DOCOPTIONS=$(DOCOPTIONS),nocolors
print:
$(MAKE) headon OPTIN=print
$(MAKE) default DOCOPTIONS=$(DOCOPTIONS),print
custom: pdf
cv:
$(MAKE) pdf PROJECT=cv
coverletter:
$(MAKE) pdf PROJECT=coverletter
default: cv coverletter
clean:
@rm -rf $(BUILDDIR)
@echo "Removed $(BUILDDIR) directory"