aboutsummaryrefslogtreecommitdiff
path: root/templates/quiz/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'templates/quiz/Makefile')
-rw-r--r--templates/quiz/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/quiz/Makefile b/templates/quiz/Makefile
new file mode 100644
index 00000000..1d424dec
--- /dev/null
+++ b/templates/quiz/Makefile
@@ -0,0 +1,17 @@
+QUESTIONS:=$(wildcard *.tex)
+PDFS:=$(QUESTIONS:.tex=.pdf)
+PNGS:=$(QUESTIONS:.tex=.png)
+JPGS:=$(QUESTIONS:.tex=.jpg)
+
+.PHONY: all
+all: $(PDFS) $(PNGS) $(JPGS)
+
+%.jpg: %.pdf
+ convert -density 600 -quality 100 $< -flatten -sharpen 0x1.0 $@
+
+%.png: %.pdf
+ convert -density 600 -quality 100 $< -flatten -sharpen 0x1.0 $@
+
+COMMON_MK = $(shell bash -c 'upfind() { [[ -f "$$1" ]] && printf "$$1" || ([ "$$(realpath $$(dirname "$$1"))" == "/" ] || upfind "../$$1") }; upfind common.mk')
+include $(COMMON_MK)
+