-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (39 loc) · 1.55 KB
/
Copy pathMakefile
File metadata and controls
47 lines (39 loc) · 1.55 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
.DEFAULT_GOAL := help
DOCKER := docker compose run --rm --no-deps texlive
BUILD := $(DOCKER) python3 latex/tools/build.py
.PHONY: help course build check all clean
help:
@echo "Daily repository commands:"
@echo " make build COURSE=1/calculus-1"
@echo " make all"
@echo " make check"
@echo " make clean"
@echo " make course YEAR=1 COURSE='Calculus 1' SHORT='Calculus' \\"
@echo " PROFESSOR='Name' SEMESTER=1 AUTHOR='Your Name' DATE=2026-08-06 LANGUAGE=english"
course:
@test -n "$(YEAR)" || (echo "YEAR is required" >&2; exit 2)
@test -n "$(COURSE)" || (echo "COURSE is required" >&2; exit 2)
@test -n "$(SHORT)" || (echo "SHORT is required" >&2; exit 2)
@test -n "$(PROFESSOR)" || (echo "PROFESSOR is required" >&2; exit 2)
@test -n "$(SEMESTER)" || (echo "SEMESTER is required" >&2; exit 2)
@test -n "$(AUTHOR)" || (echo "AUTHOR is required" >&2; exit 2)
@test -n "$(DATE)" || (echo "DATE is required" >&2; exit 2)
@test -n "$(LANGUAGE)" || (echo "LANGUAGE is required" >&2; exit 2)
$(DOCKER) python3 latex/tools/create_course.py \
--year "$(YEAR)" \
--course "$(COURSE)" \
--short-course "$(SHORT)" \
--professor "$(PROFESSOR)" \
--semester "$(SEMESTER)" \
--author "$(AUTHOR)" \
--date "$(DATE)" \
--language "$(LANGUAGE)"
build:
@test -n "$(COURSE)" || (echo "COURSE is required, for example COURSE=1/calculus-1" >&2; exit 2)
$(BUILD) "$(COURSE)"
check:
pre-commit run --all-files --show-diff-on-failure
all:
$(BUILD) --all --keep-going
clean:
$(DOCKER) python3 -c "import shutil; shutil.rmtree('.build', ignore_errors=True)"