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
48
49
50
51
# Makefile for Sparse test suite
#
# Ken Kundert
# kundert@users.sourceforge.net
#
# To run tests ...
# On Linux machines run: make
# On Unix machines run: gnumake
#
# To run the tests use: make
# To compare against archived results use: make compare
# To update archived results use: make update
# To remove the results files use: make clean
SPARSE = ../bin/sparse
OUT_FILES = $(patsubst %.mat,%.out,$(wildcard *.mat)) \
$(patsubst %.mat.gz,%.out,$(wildcard *.mat.gz))
GOLDEN_FILES = $(patsubst %.out,Archive/%.out,$(wildcard *.out))
all: $(OUT_FILES)
$(OUT_FILES): $(SPARSE)
%.out: %.mat ; $(SPARSE) $< > $@
# On Unix machines may need to replace zcat on the following line with gzcat
%.out: %.mat.gz ; zcat $< | $(SPARSE) > $@
clean:
rm -f $(OUT_FILES)
# The following rules are used to create and compare against
# a set of golden results files.
# update the golden results files (only do this when you
# are sure the current output files exist and are up to date)
update: $(GOLDEN_FILES)
Archive/%.out: %.out ; grep -vi time $< | grep -vi memory > $@
compare:
@for outfile in *.out; do \
if grep -vi time $$outfile | grep -vi memory | cmp -s - Archive/$$outfile; then \
echo -n; \
else \
echo "diff detected in $$outfile"; \
grep -vi time $$outfile | grep -vi memory | diff - Archive/$$outfile; \
fi; \
done