Makefile 999 Bytes
Newer Older
Martin Isaksson's avatar
Martin Isaksson committed
1
2
3
4
SOURCES=main.tex
PDF_OBJECTS=$(SOURCES:.tex=.pdf)

LATEXMK=latexmk
Martin Isaksson's avatar
Martin Isaksson committed
5
LATEXMK_OPTIONS=-bibtex -pdf -pdflatex="pdflatex -interaction=nonstopmode"
Martin Isaksson's avatar
Martin Isaksson committed
6
7

DOCKER=docker
Martin Isaksson's avatar
Martin Isaksson committed
8
DOCKER_COMMAND=run --rm -w /data/ --env LATEXMK_OPTIONS_EXTRA=$(LATEXMK_OPTIONS_EXTRA)
Martin Isaksson's avatar
Martin Isaksson committed
9
10
11
12
13
14
15
DOCKER_MOUNT=-v`pwd`:/data

all: render

pdf: $(PDF_OBJECTS)

%.pdf: %.tex
Martin Isaksson's avatar
Martin Isaksson committed
16
17
	@echo Input file: $<
	$(LATEXMK) $(LATEXMK_OPTIONS_EXTRA) $(LATEXMK_OPTIONS) $<
Martin Isaksson's avatar
Martin Isaksson committed
18
19
20

clean:
	-$(LATEXMK) -bibtex -C main
Martin Isaksson's avatar
Martin Isaksson committed
21
	-make -C figures clean
Martin Isaksson's avatar
Martin Isaksson committed
22
23
24
25
26

dist-clean: clean
	-rm $(FILENAME).tar.gz

render:
Martin Isaksson's avatar
Martin Isaksson committed
27
	$(DOCKER) $(DOCKER_COMMAND) $(DOCKER_MOUNT) blang/latex:ctanfull \
Martin Isaksson's avatar
Martin Isaksson committed
28
		make pdf
Martin Isaksson's avatar
Martin Isaksson committed
29

30
check:
Martin Isaksson's avatar
Martin Isaksson committed
31
32
33
34
35

	@- $(foreach FILE, $(PDF_OBJECTS), \
		test -e $(FILE) ; \
	)

Martin Isaksson's avatar
Martin Isaksson committed
36
37
38
	rspec spec/pdf_spec.rb

figures:
Martin Isaksson's avatar
Martin Isaksson committed
39
	$(DOCKER) $(DOCKER_COMMAND) $(DOCKER_MOUNT) python:3.8 \
Martin Isaksson's avatar
Martin Isaksson committed
40
41
42
		make -C /data/figures

debug:
Martin Isaksson's avatar
Martin Isaksson committed
43
	$(DOCKER) $(DOCKER_COMMAND) -it $(DOCKER_MOUNT) blang/latex:ctanfull \
Martin Isaksson's avatar
Martin Isaksson committed
44
45
		bash

46
check_docker:
Martin Isaksson's avatar
Martin Isaksson committed
47
48
49
	$(DOCKER) $(DOCKER_COMMAND) -it $(DOCKER_MOUNT) ruby:2.7.1 \
		bundle update --bundler; make check

Martin Isaksson's avatar
Martin Isaksson committed
50
.PHONY: figures