-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (57 loc) 路 2.53 KB
/
Copy pathMakefile
File metadata and controls
82 lines (57 loc) 路 2.53 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
# Targets:
# default : compiles the document to a PDF file using the defined
# latex generating engine. (pdflatex, xelatex, etc)
# display : displays the compiled document in a common PDF viewer.
# (currently linux = evince, OSX = open)
# clean : removes the out/ directory holding temporary files
# Sources for your .tex an .bib files
SRC = src
# Specify the names of the .tex files. They must be in SRC
# Active resumes (Java/Kotlin)
PROJECTS = cv-java.ru cv-java.en
# DEPRECATED (Ruby), no longer maintained, kept for reference.
DEPRECATED_PROJECTS = cv-ruby.ru cv-ruby.en
# PROJECTS += $(DEPRECATED_PROJECTS)
PROJECTS_PATHS = $(addprefix $(OUT)/, $(PROJECTS))
PROJECTS_TARGETS = $(addsuffix .pdf, $(PROJECTS_PATHS))
# The OUT directory is not to be used
# The auxiliary files generated by latex, bibtex, and other tools will be redirected to this folder
# Generated DVI, PS, and PDF files will also be placed in this directory
OUT = out
.PHONY: clean
default: $(PROJECTS_TARGETS)
display: default
(${PDFVIEWER} $(PROJECTS_TARGETS) &)
### Compilation Flags
PDFLATEX_FLAGS = -cd -f -halt-on-error -lualatex -interaction=nonstopmode -synctex=1 -output-directory=../$(OUT)/
### File Types (for dependancies)
TEX_FILES = $(shell find $(SRC) -name '*.tex' -or -name '*.sty' -or -name '*.cls')
BIB_FILES = $(shell find $(SRC) -name '*.bib')
BST_FILES = $(shell find $(SRC) -name '*.bst')
IMG_FILES = $(shell find . -path '*.jpg' -or -path '*.png' -or \( \! -path './$(OUT)/*.pdf' -path '*.pdf' \) )
### Standard PDF Viewers
# Defines a set of standard PDF viewer tools to use when displaying the result
# with the display target. Currently chosen are defaults which should work on
# most linux systems with GNOME installed and on all OSX systems.
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
PDFVIEWER = evince
endif
ifeq ($(UNAME), Darwin)
PDFVIEWER = open
endif
### Clean
# This target cleans the temporary files generated by the tex programs in
# use. All temporary files generated by this makefile will be placed in OUT/
# so cleanup is easy.
clean::
find $(OUT)/ ! -name '.keep' -type f -exec rm -f {} +
### Core Latex Generation
# Performs the typical build process for latex generations so that all
# references are resolved correctly. If adding components to this run-time
# always take caution and implement the worst case set of commands.
# Example: latex, bibtex, latex, latex
$(OUT)/:
mkdir -p $(OUT)/
$(PROJECTS_TARGETS): $(TEX_FILES) $(IMG_FILES) | $(OUT)/
latexmk $(PDFLATEX_FLAGS) $(SRC)/$(@F:.pdf=.tex)