-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
44 lines (34 loc) · 1022 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
ifndef DISTRIBUIRALUNOS
FORMULAS=$(wildcard formulas/*cnf)
else
FORMULAS=formulas/simples.cnf\
formulas/uf20-01.cnf\
formulas/flat75-90.cnf
TIMELIMIT?=5
endif
INPUT=$(patsubst formulas/%.cnf,input/%,${FORMULAS})
TESTRUN=$(patsubst formulas/%.cnf,benchmark/%,${FORMULAS})
VERIFICARUN=$(patsubst benchmark/%,verificar/%,${TESTRUN})
TIMELIMIT?=30
DEFAULTSEED?=3000
GSATGENERATOR=./simple-gsat-io-generator
BENCHMARKBINARY?=$(GSATGENERATOR)
all: $(INPUT)
input/%: formulas/%.cnf
./simple-gsat-io-generator generator $(DEFAULTSEED) $^ $@ $(patsubst input/%,output/%,$@) $(TIMELIMIT)
benchmark/%: input/%
@echo "== $^"
time -p $(BENCHMARKBINARY) < $^ > $@
benchmark: benchmarkdir all $(TESTRUN)
benchmarkdir:
mkdir -p benchmark
verificar/%: output/%
@echo "==== Comparando $^"
@diff -q -s $^ $(patsubst verificar/%,benchmark/%,$@)
@echo
verificar: benchmark $(VERIFICARUN)
clean:
rm -f benchmark/*
dist-clean: clean
rm -f input/* output/*
PHONY: all benchmark benchmarkdir clean dist-clean verificar