-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (20 loc) · 907 Bytes
/
Makefile
File metadata and controls
27 lines (20 loc) · 907 Bytes
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
TARGET_DIR := target
LECTURE_SOURCES := $(wildcard lectures/*/main.tex)
LECTURES := $(patsubst lectures/%/main.tex,%,$(LECTURE_SOURCES))
LATEX_FLAGS := -pdf -interaction=nonstopmode -lualatex
.PHONY: all clean dev list $(LECTURES)
.ONESHELL:
all: $(LECTURES)
$(LECTURES):
@echo "--- Building: $@ ---"
@mkdir -p $(TARGET_DIR)/$@
TEXINPUTS="lectures/$@/:packages/:" BIBINPUTS="lectures/$@/:" latexmk $(LATEX_FLAGS) -view=none -outdir=$(TARGET_DIR)/$@ -jobname="$@" lectures/$@/main.tex
dev:
@LEC=$$(echo "$(LECTURES)" | tr ' ' '\n' | sort -r | fzf --prompt="Select lecture to watch: ")
@mkdir -p $(TARGET_DIR)/$$LEC
TEXINPUTS="lectures/$$LEC/:packages/:" BIBINPUTS="lectures/$$LEC/:" latexmk $(LATEX_FLAGS) -pvc -outdir=$(TARGET_DIR)/$$LEC -jobname="$$LEC" lectures/$$LEC/main.tex
list:
@echo "Detected lectures:"
@for lec in $(LECTURES); do echo " - $$lec"; done
clean:
rm -rf $(TARGET_DIR)