-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
147 lines (126 loc) · 4.94 KB
/
Makefile
File metadata and controls
147 lines (126 loc) · 4.94 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Makefile for CV generation
# Author: Leonid Petrov
# LaTeX compiler settings
LATEX = latexmk
LATEX_FLAGS = -pdf -silent -synctex=1
CLEAN_FLAGS = -c
# Source files
CV_FULL = __petrovCV__.tex
CV_SHORT = __petrovCV__short.tex
CV_BRIEF = __petrovCV__brief_2page.tex
CV_BRIEF_ONE_MORE = __petrovCV__brief_2page_one_more.tex
PUBL = __petrov__publ.tex
# Generated PDFs
PDF_FULL = __petrovCV__.pdf
PDF_SHORT = __petrovCV__short.pdf
PDF_BRIEF = __petrovCV__brief_2page.pdf
PDF_BRIEF_ONE_MORE = __petrovCV__brief_2page_one_more.pdf
PDF_PUBL = __petrov__publ.pdf
# Remote publication lists
PUBLIST_URL = https://lpetrov.cc/research/TEX_publist.tex
CV_PUBLIST_URL = https://lpetrov.cc/research/TEX_CV_publist.tex
CV_PUBLIST_SHORT_URL = https://lpetrov.cc/research/TEX_CV_publist_short.tex
CV_PUBLIST_SELECTED_URL = https://lpetrov.cc/research/TEX_CV_publist_selected.tex
# Local publication list files
PUBLIST_TEX = TEX_publist.tex
CV_PUBLIST_TEX = TEX_CV_publist.tex
CV_PUBLIST_SHORT_TEX = TEX_CV_publist_short.tex
CV_PUBLIST_SELECTED_TEX = TEX_CV_publist_selected.tex
# Default target
all: $(PDF_FULL) $(PDF_SHORT) $(PDF_BRIEF) $(PDF_BRIEF_ONE_MORE) $(PDF_PUBL)
@echo "Cleaning up intermediate files..."
$(LATEX) $(CLEAN_FLAGS) $(CV_FULL)
$(LATEX) $(CLEAN_FLAGS) $(CV_SHORT)
$(LATEX) $(CLEAN_FLAGS) $(CV_BRIEF)
$(LATEX) $(CLEAN_FLAGS) $(CV_BRIEF_ONE_MORE)
$(LATEX) $(CLEAN_FLAGS) $(PUBL)
rm -f $(PUBLIST_TEX) $(CV_PUBLIST_TEX) $(CV_PUBLIST_SHORT_TEX) $(CV_PUBLIST_SELECTED_TEX)
rm -f *.gz
# Download publication lists
download-publists:
@echo "Downloading publication lists..."
wget -q --no-clobber=off $(PUBLIST_URL) -O $(PUBLIST_TEX)
wget -q --no-clobber=off $(CV_PUBLIST_URL) -O $(CV_PUBLIST_TEX)
wget -q --no-clobber=off $(CV_PUBLIST_SHORT_URL) -O $(CV_PUBLIST_SHORT_TEX)
wget -q --no-clobber=off $(CV_PUBLIST_SELECTED_URL) -O $(CV_PUBLIST_SELECTED_TEX)
# Build full CV
$(PDF_FULL): $(CV_FULL) download-publists
@echo "Building full CV..."
$(LATEX) $(LATEX_FLAGS) $(CV_FULL)
# Build short CV
$(PDF_SHORT): $(CV_SHORT) download-publists
@echo "Building short CV..."
$(LATEX) $(LATEX_FLAGS) $(CV_SHORT)
# Build publication list
$(PDF_PUBL): $(PUBL) download-publists
@echo "Building publication list..."
$(LATEX) $(LATEX_FLAGS) $(PUBL)
# Build brief CV (2 page)
$(PDF_BRIEF): $(CV_BRIEF) download-publists
@echo "Building brief CV (2 page)..."
$(LATEX) $(LATEX_FLAGS) $(CV_BRIEF)
# Build brief CV (2 page one more)
$(PDF_BRIEF_ONE_MORE): $(CV_BRIEF_ONE_MORE) download-publists
@echo "Building brief CV (2 page one more)..."
$(LATEX) $(LATEX_FLAGS) $(CV_BRIEF_ONE_MORE)
# Clean intermediate files
clean:
@echo "Cleaning intermediate files..."
$(LATEX) $(CLEAN_FLAGS) $(CV_FULL)
$(LATEX) $(CLEAN_FLAGS) $(CV_SHORT)
$(LATEX) $(CLEAN_FLAGS) $(CV_BRIEF)
$(LATEX) $(CLEAN_FLAGS) $(CV_BRIEF_ONE_MORE)
$(LATEX) $(CLEAN_FLAGS) $(PUBL)
rm -f $(PUBLIST_TEX) $(CV_PUBLIST_TEX) $(CV_PUBLIST_SHORT_TEX) $(CV_PUBLIST_SELECTED_TEX)
rm -f *.gz
# Clean everything including PDFs
clean-all: clean
@echo "Cleaning PDFs..."
rm -f $(PDF_FULL) $(PDF_SHORT) $(PDF_BRIEF) $(PDF_BRIEF_ONE_MORE) $(PDF_PUBL)
# Build and commit (replacement for git hook functionality)
build-and-commit: clean all
@echo "Adding PDFs to git..."
git add $(PDF_FULL) $(PDF_SHORT) $(PDF_BRIEF) $(PDF_BRIEF_ONE_MORE) $(PDF_PUBL)
@echo "PDFs built and staged for commit"
# Deploy: stage all changes, commit with git's built-in context, and push
deploy: clean all
@echo "Staging all changes..."
git add .
@echo "Opening git commit dialog..."
git commit -v
@echo "Pushing to remote..."
git push
# Autodeploy: build, stage, commit, push in one shot
autodeploy: clean all
@echo "Staging all changes..."
git add .
git commit -m "autodeploy"
@echo "Pushing to remote..."
git push
# Individual targets
cv-full: $(PDF_FULL)
cv-short: $(PDF_SHORT)
cv-brief: $(PDF_BRIEF)
cv-brief-one-more: $(PDF_BRIEF_ONE_MORE)
publications: $(PDF_PUBL)
# Force rebuild
rebuild: clean all
# Show help
help:
@echo "Available targets:"
@echo " all - Build all documents (default)"
@echo " cv-full - Build full CV only"
@echo " cv-short - Build short CV only"
@echo " cv-brief - Build brief CV (2 page) only"
@echo " cv-brief-one-more - Build brief CV (2 page one more) only"
@echo " publications - Build publication list only"
@echo " download-publists - Download publication lists from web"
@echo " clean - Clean intermediate files"
@echo " clean-all - Clean all files including PDFs"
@echo " rebuild - Clean and rebuild all"
@echo " build-and-commit - Build and stage PDFs for git commit"
@echo " deploy - Build, stage all changes, commit with git dialog, and push"
@echo " autodeploy - Build, stage, commit 'autodeploy', and push"
@echo " help - Show this help message"
# Declare phony targets
.PHONY: all clean clean-all download-publists build-and-commit deploy autodeploy rebuild help cv-full cv-short cv-brief cv-brief-one-more publications