Makefile 1.79 KB
Newer Older
Lukas Nagel's avatar
Lukas Nagel committed
1
# Targets
Lukas Nagel's avatar
Lukas Nagel committed
2

Lukas Nagel's avatar
Lukas Nagel committed
3
4
5
mindmap=\
	mindmap/MindMap.pdf \
	mindmap/ProjectGraph.pdf
Lukas Nagel's avatar
Lukas Nagel committed
6

Lukas Nagel's avatar
Lukas Nagel committed
7
8
presentation=\
	presentation/presentation.pdf
Lukas Nagel's avatar
Lukas Nagel committed
9

Lukas Nagel's avatar
Lukas Nagel committed
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

versionsgraphen=\
	grafiken/ex1-graph.pdf \
	grafiken/ex1-graph-precommit.pdf \
	grafiken/ex2-graph-precommit.pdf \
	grafiken/ex2-graph.pdf \
	grafiken/ex3-graph-premerge.pdf \
	grafiken/ex3-graph.pdf \
	grafiken/ex4-graph-prefetch.pdf \
	grafiken/ex4-graph-premerge.pdf \
	grafiken/ex4-graph.pdf \
	grafiken/merge-fast-forward-premerge.pdf \
	grafiken/merge-fast-forward.pdf \
	grafiken/merge-three-way-premerge.pdf \
	grafiken/merge-three-way.pdf

grafiken=\
	$(versionsgraphen) \
	grafiken/github-workflow.pdf \
	grafiken/git-object.pdf

bilder=\
	presentation/github-repo.png \
	presentation/github-userpage.png \
	presentation/kinda-sus.png

dokumente=$(mindmap) $(presentation)

latex=$(mindmap) $(presentation) $(grafiken)

buildirs=$(latex:pdf=out)

previews=$(mindmap:pdf=gif)

# Rules

default: $(dokumente)

Lukas Nagel's avatar
Lukas Nagel committed
48
all: $(latex) $(previews)
Lukas Nagel's avatar
Lukas Nagel committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62

grafiken: $(grafiken)

mindmap: $(mindmap)

presentation: $(presentation)


# Dependencies

$(grafiken): grafiken/theme.tex

$(versionsgraphen) git-object: grafiken/versiongraph.tex

Lukas Nagel's avatar
Lukas Nagel committed
63
$(presentation): $(grafiken) $(bilder) presentation/theme.tex
Lukas Nagel's avatar
Lukas Nagel committed
64
65
66
67
68


# Generic Recipes

%.pdf: %.tex
Lukas Nagel's avatar
Lukas Nagel committed
69
	@echo "make: Entering directory '$(@D)'"
Lukas Nagel's avatar
Lukas Nagel committed
70
71
	cd $(@D) && \
		latexrun --latex-cmd lualatex -o $(@F) -O $(*F).out $(<F)
Lukas Nagel's avatar
Lukas Nagel committed
72
	@echo "make: Leaving directory '$(@D)'"
Lukas Nagel's avatar
Lukas Nagel committed
73
	touch -c $@ # latexrun quirk
Lukas Nagel's avatar
Lukas Nagel committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

%.gif: %.pdf
	convert \
		-density 300 \
		-bordercolor transparent \
		-background transparent \
		$< -border 400x0 $@


# Clean up

clean: polish
	rm -rf $(latex)
	rm -rf $(previews)

polish:
	rm -rf $(buildirs)


# Docker
94

95
96
97
docker:
	make -C docker

98
with-docker:
Lukas Nagel's avatar
Lukas Nagel committed
99
	docker run -v ${PWD}:/build:rw -it $${DOCKER_TAG:-itt:latest} "make -C /build $(RULE)"
100

Lukas Nagel's avatar
Lukas Nagel committed
101
.PHONY: presentation mindmap clean docker polish