Automate rerunning when we have to back off: gives accurate(ish) timings.
[ccan] / ccan / tdb / tools / Makefile
1 LDLIBS:=-lccan
2 CFLAGS:=-I../../.. -Wall -O3 #-g -pg
3 LDFLAGS:=-L../../..
4
5 default: replay_trace tdbtorture tdbdump
6
7 replay_trace: replay_trace.c keywords.c
8         $(LINK.c) $< $(LOADLIBES) $(LDLIBS) -o $@
9
10 keywords.c: keywords.gperf
11         gperf $< > $@
12
13 check: replay_trace
14         @rm -f *.reduced_trace
15         @set -e; for f in tests/*.trace.tar.bz2; do             \
16                 tar xvfj $$f;                                   \
17                 ./replay_trace replay.tdb *.reduced_trace;      \
18                 rm -f *.reduced_trace;                          \
19         done
20
21 # Usage: make mytest.trace.tar.bz2 TRACEFILES=*.trace
22 %.trace.tar.bz2: $(patsubst %.trace,%.reduced_trace,$(wildcard $(TRACEFILES)))
23         tar cvfj $@ $^
24
25 %.reduced_trace: %.trace
26         @sed 's/\(^[0-9]* traverse\) .*/\1fn/' < $^ > $@
27
28 clean:
29         rm -f replay_trace tdbtorture tdbdump *.o