-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
47 lines (35 loc) · 1020 Bytes
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
INPUT=$(wildcard input/*)
OUTPUT=$(patsubst input/%,output/%,$(INPUT))
TESTRUN=$(patsubst input/%,benchmark/%,$(INPUT))
VERIFICARUN?=$(patsubst input/%,verificar/%,$(INPUT))
TIMELIMIT?=70
GABARITO=./prof/ribas-ac-ingenuo
BENCHMARKBINARY?=$(GABARITO)
check: /usr/bin/tar /usr/bin/time /usr/bin/diff
input/.create: input.tar.gz
tar xf input.tar.gz
@touch input/.create
output/%: input/%
@echo "* Processando $^"
@time -p $(GABARITO) $^ > $@
@echo
gerargabarito: input/.create outputdir $(GABARITO) $(OUTPUT)
outputdir:
mkdir -p output
benchmark/%: input/%
@echo "* Processando $^"
time -p $(BENCHMARKBINARY) $^ > $@
@echo
benchmark: benchmarkdir input/.create $(TESTRUN)
benchmarkdir:
mkdir -p benchmark
verificar/%: output/%
@echo "* Comparando $^"
@diff -q -s $^ $(patsubst verificar/%,benchmark/%,$@)
@echo
verificar: benchmark $(VERIFICARUN)
clean:
rm -rf benchmark
dist-clean: clean
rm -rf input output
PHONY: check benchmark benchmarkdir clean dist-clean verificar gerargabarito outputdir