forked from ai4eda/awesome-AI4EDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (61 loc) · 1.92 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Makefile to build PDF and Markdown pub from YAML.
#
# Brandon Amos <http://bamos.github.io> and
# Ellis Michael <http://ellismichael.com>
WEBSITE_DIR=../ai4eda.github.io
WEBSITE_PDF=$(WEBSITE_DIR)/data/pub.pdf
WEBSITE_MD=$(WEBSITE_DIR)/_includes/pub.md
WEBSITE_DATE=$(WEBSITE_DIR)/_includes/last-updated.txt
TEMPLATES=$(shell find templates -type f)
BUILD_DIR=build
TEX=$(BUILD_DIR)/pub.tex
PDF=$(BUILD_DIR)/pub.pdf
MD=$(BUILD_DIR)/pub.md
ifneq ("$(wildcard pub.hidden.yaml)","")
YAML_FILES = pub.yaml pub.hidden.yaml
else
YAML_FILES = pub.yaml
endif
.PHONY: all public viewpdf stage jekyll push clean
all: $(PDF) $(MD)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
public: $(BUILD_DIR) $(TEMPLATES) $(YAML_FILES) generate.py
./generate.py -m pub.yaml
$(TEX) $(MD): $(TEMPLATES) $(YAML_FILES) generate.py publications/*.bib
./generate.py -m $(YAML_FILES)
# $(PDF): $(TEX)
# # TODO: Hack for biber on OSX.
# rm -rf /var/folders/8p/lzk2wkqj47g5wf8g8lfpsk4w0000gn/T/par-62616d6f73
# latexmk -pdf -cd- -jobname=$(BUILD_DIR)/pub $(BUILD_DIR)/pub
# latexmk -c -cd $(BUILD_DIR)/pub
md: $(BUILD_DIR) $(TEMPLATES) $(YAML_FILES) generate.py
./generate.py -m pub.yaml
cp $(MD) $(WEBSITE_MD)
date +%Y-%m-%d > $(WEBSITE_DATE)
viewpdf: $(PDF)
open $(PDF)
wslpdf:
wslview $(PDF)
# stagemd: $(MD)
# cp $(MD) $(WEBSITE_MD)
# date +%Y-%m-%d > $(WEBSITE_DATE)
# stage: $(PDF) $(MD)
# cp $(PDF) $(WEBSITE_PDF)
# cp $(MD) $(WEBSITE_MD)
# date +%Y-%m-%d > $(WEBSITE_DATE)
stage: $(MD)
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 pub."
# git -C $(WEBSITE_DIR) push
push: stage
git -C $(WEBSITE_DIR) add $(WEBSITE_MD) $(WEBSITE_DATE)
git -C $(WEBSITE_DIR) commit -m "Update pub."
git -C $(WEBSITE_DIR) push
clean:
rm -rf *.db $(BUILD_DIR)/pub*