-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (24 loc) · 1.05 KB
/
Makefile
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
MAKEFLAGS := -j 4
SHELL := /bin/bash
.DELETE_ON_ERROR:
PROBLEM_DESCRIPTIONS_MD := $(wildcard problems/*/description.md)
PROBLEM_DESCRIPTIONS_HTML := $(PROBLEM_DESCRIPTIONS_MD:%.md=%.html)
all: problems.pdf instructions.pdf
include $(wildcard problems/*/Makefile)
test-%:
@for f in $(sort $(wildcard problems/$*/solutions/*.run)); do \
for g in $(sort $(wildcard problems/$*/tests/*.in)); do \
if /usr/bin/time -o/tmp/lucid-programming-time -f%E /usr/bin/timeout 10s colordiff -b "$${g/.in/.out}" <("$$f" < "$$g"); then \
echo "Solution $$(basename $$f .run), Test $$(basename $$g .in): SUCCESS ($$(< /tmp/lucid-programming-time))"; \
else \
echo "Solution $$(basename $$f .run), Test $$(basename $$g .in): FAILURE ($$(< /tmp/lucid-programming-time))"; \
fi \
done \
done
TESTS := $(shell echo problems/*/tests)
.PHONY: zip
zip: zip
python3 zipup.py
%.html: %.md convert.html.erb
ruby -rerb -rnet/http -e 'puts ERB.new(File.read "convert.html.erb").result' < $< > $@
PDF_OPTIONS := -g -B 15mm -L 20mm -R 20mm -T 20mm -s Letter --print-media-type