Commit e86c41da authored by Lukas Nagel's avatar Lukas Nagel
Browse files

unify Makefile

parent 67970646
......@@ -15,11 +15,10 @@ default:
mindmap:
stage: build
script:
- cd mindmap
- make MindMap.pdf
- make MindMap.gif
- make ProjectGraph.pdf
- make ProjectGraph.gif
- make mindmap/MindMap.pdf
- make mindmap/MindMap.gif
- make mindmap/ProjectGraph.pdf
- make mindmap/ProjectGraph.gif
artifacts:
paths:
- mindmap/MindMap.pdf
......@@ -30,8 +29,7 @@ mindmap:
presentation:
stage: build
script:
- cd presentation
- make presentation.pdf
- make presentation/presentation.pdf
artifacts:
paths:
- presentation/presentation.pdf
all: mindmap presentation
# Targets
mindmap:
make -C mindmap
mindmap=\
mindmap/MindMap.pdf \
mindmap/ProjectGraph.pdf
presentation:
make -C presentation
presentation=\
presentation/presentation.pdf
clean:
make -C mindmap clean
make -C docker clean
make -C presentation clean
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)
all: docker $(dokumente) $(previews)
grafiken: $(grafiken)
mindmap: $(mindmap)
presentation: $(presentation)
# Dependencies
$(grafiken): grafiken/theme.tex
$(versionsgraphen) git-object: grafiken/versiongraph.tex
$(presentation): $(grafiken) $(bilder)
# Generic Recipes
%.pdf: %.tex
cd $(@D) && \
latexrun --latex-cmd lualatex -o $(@F) -O $(*F).out $(<F)
%.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
docker:
make -C docker
with-docker:
docker run -v ${PWD}:/build:rw -it $${DOCKER_TAG:-itt:latest} "make -C /build"
docker run -v ${PWD}:/build:rw -it $${DOCKER_TAG:-itt:latest} "make -C /build $(RULE)"
.PHONY: presentation mindmap clean docker
.PHONY: presentation mindmap clean docker polish
versionsgraph=\
ex1-graph.pdf \
ex1-graph-precommit.pdf \
ex2-graph-precommit.pdf \
ex2-graph.pdf \
ex3-graph-premerge.pdf \
ex3-graph.pdf \
ex4-graph-prefetch.pdf \
ex4-graph-premerge.pdf \
ex4-graph.pdf \
merge-fast-forward-premerge.pdf \
merge-fast-forward.pdf \
merge-three-way-premerge.pdf \
merge-three-way.pdf \
git-object.pdf \
all=\
$(versionsgraph) \
github-workflow.pdf
default: $(all)
$(all): theme.tex
$(versionsgraph): versiongraph.tex
%.pdf: %.tex
latexrun --latex-cmd lualatex -o $@ -O $*.out $<
polish:
rm -rf *.out
clean: polish
rm -f *.pdf
.PHONY: polish
default: ProjectGraph.pdf MindMap.pdf | polish
all: ProjectGraph.pdf MindMap.pdf ProjectGraph.gif MindMap.gif
%.pdf: %.tex
latexrun -o $@ -O $*.out $< ||\
if [[ -e $*.out/$@ ]]; then mv $*.out/$@ $@; else exit 42; fi;
%.gif: %.pdf
convert \
-density 300 \
-bordercolor transparent \
-background transparent \
$< -border 400x0 $@
polish:
rm -rf MindMap.out
rm -rf ProjectGraph.out
clean: polish
rm -f *.pdf
rm -f *.gif
.PHONY: polish
default: presentation.pdf
presentation.pdf: theme.tex
%.pdf: %.tex
latexrun --latex-cmd lualatex -o $@ -O $*.out $<
polish:
rm -rf presentation.out
clean: polish
rm -f *.pdf
.PHONY: polish
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment