generated from teslabs/zds-beamer-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (36 loc) · 932 Bytes
/
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
# Slides Makefile
#
# Gerard Marull-Paretas <gerard@teslabs.com>
# Copyright (c) 2021 Teslabs Engineering S.L.
# programs
MKDIR := mkdir
LATEXMK := latexmk
PDFLATEX := pdflatex
CHKTEX := chktex
LATEXINDENT := latexindent
# options
BUILD_DIR := build
PDF_OPTS := -shell-escape -interaction=nonstopmode
# sources
SOURCES := slides.tex
SOURCES_PDF := $(patsubst %.tex,$(BUILD_DIR)/%.pdf,$(SOURCES))
SOURCES_LINT := $(patsubst %.tex,lint-%,$(SOURCES))
SOURCES_FMT := $(patsubst %.tex,fmt-%,$(SOURCES))
.PHONY: all lint fmt clean
all: $(SOURCES_PDF)
$(BUILD_DIR)/%.pdf: %.tex | $(BUILD_DIR)
$(LATEXMK) \
-pdf \
-pdflatex="$(PDFLATEX) $(PDF_OPTS)" \
-jobname=$(patsubst %.pdf,%,$@) \
$<
$(BUILD_DIR):
$(MKDIR) -p $(BUILD_DIR)
lint: $(SOURCES_LINT)
lint-%: %.tex
$(CHKTEX) $<
fmt: $(SOURCES_FMT)
fmt-%: %.tex
$(LATEXINDENT) -s -l -w $<
clean:
rm -rf $(BUILD_DIR) _minted-* *.log *.bak*