56d301cff50f4a139588d35df74b6512da30eb28
[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 benchmark: replay_trace
8         @trap "rm -f /tmp/trace.$$$$" 0; for f in benchmarks/*.rz; do if runzip -k $$f -o /tmp/trace.$$$$ && echo -n "$$f": && ./replay_trace --quiet -n 5 replay.tdb /tmp/trace.$$$$ && rm /tmp/trace.$$$$; then rm -f /tmp/trace.$$$$; else exit 1; fi; done
9
10 replay_trace: replay_trace.c keywords.c
11         $(LINK.c) $< $(LOADLIBES) $(LDLIBS) -o $@
12
13 keywords.c: keywords.gperf
14         gperf $< > $@
15
16 check: replay_trace
17         @rm -f *.reduced_trace
18         @set -e; for f in tests/*.trace.tar.bz2; do             \
19                 tar xvfj $$f;                                   \
20                 ./replay_trace replay.tdb *.reduced_trace;      \
21                 rm -f *.reduced_trace;                          \
22         done
23
24 # Usage: make mytest.trace.tar.bz2 TRACEFILES=*.trace
25 %.trace.tar.bz2: $(patsubst %.trace,%.reduced_trace,$(wildcard $(TRACEFILES)))
26         tar cvfj $@ $^
27
28 %.reduced_trace: %.trace
29         @sed 's/\(^[0-9]* traverse\) .*/\1fn/' < $^ > $@
30
31 clean:
32         rm -f replay_trace tdbtorture tdbdump *.o