-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
60 lines (43 loc) · 1.46 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
# Makefile to build PDF and Markdown cv from YAML.
# Wilka Carvalho <http://wcarvalho.github.io> and
# Brandon Amos <http://bamos.github.io> and
# Ellis Michael <http://ellismichael.com>
WEBSITE_DIR=$(HOME)/git/wcarvalho.github.io
WEBSITE_PDF=$(WEBSITE_DIR)/files/wilka_carvalho_CV.pdf
WEBSITE_MD=$(WEBSITE_DIR)/_includes/cv.md
WEBSITE_DATE=$(WEBSITE_DIR)/_includes/last-updated.txt
TEMPLATES=$(shell find templates -type f)
BUILD_DIR=build
TEX=$(BUILD_DIR)/cv.tex
PDF=$(BUILD_DIR)/cv.pdf
MD=$(BUILD_DIR)/cv.md
# ifneq ("$(wildcard cv.hidden.yaml)","")
YAML_FILES=yaml/*.yaml
# else
# YAML_FILES = cv_academic.yaml
# endif
.PHONY: all public viewpdf stage jekyll push clean
all: $(PDF) $(MD)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(TEX) $(MD): $(TEMPLATES) $(YAML_FILES) generate.py
ipython generate.py -- $(YAML_FILES) cv_academic.yaml --latex
$(PDF): $(TEX)
# TODO: Hack for biber on OSX.
# rm -rf /var/folders/zt/2qb2nh5x04d3x7qxgpgvlkk40000gn/T/par-77696c6b61/cache-ec7adafccc6b3891989ad6eb09778d44c1fecb97
cp templates/latex/res.cls $(BUILD_DIR)
cd $(BUILD_DIR) && latexmk -pdf cv
viewpdf: $(PDF)
open $(PDF)
stage: $(PDF) $(MD)
cp $(PDF) $(WEBSITE_PDF)
# cp $(MD) $(WEBSITE_MD)
# date +%Y-%m-%d > $(WEBSITE_DATE)
jekyll: stage
cd $(WEBSITE_DIR) && bundle exec jekyll server
push: stage
git -C $(WEBSITE_DIR) add $(WEBSITE_PDF) $(WEBSITE_MD) $(WEBSITE_DATE)
git -C $(WEBSITE_DIR) commit -m "Update cv."
git -C $(WEBSITE_DIR) push
clean:
rm -rf $(BUILD_DIR)/cv*