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
|
BASE=..
include ../Makefile
# Search these paths for dependency targets
VPATH=..:.
LDFLAGS+=-lcunit -levent
CFLAGS+=-I. -I.. -g $(EXTRA_CFLAGS)
CLEANOBJ=*.o *.gentest.c *_xdr.[hco] _*.c
CLEANBIN=*.test
TESTS=$(wildcard *.test.c)
#TESTS=grok_pattern.test.c grok_capture.test.c grok_simple.test.c
.PHONY: test
test: test-c test-ruby
.PHONY: test-c
test-c:
@for t in $(TESTS:.c=); do \
./runtest.sh $$t; \
done
.PHONY: test-ruby
test-ruby:
$(MAKE) -C ../ruby/test test
%.c: gentest.sh
%.test.o: %.test.c
./gentest.sh $< > _$<
$(CC) $(CFLAGS) -c _$< -o $@;
rm _$<
$(GROKOBJ):
make -C $(BASE) $@
mv $(BASE)/$@ .
stringhelper.test: ../stringhelper.o
grok_pattern.test: $(GROKOBJ)
grok_capture.test: $(GROKOBJ)
grok_simple.test: $(GROKOBJ)
grok_manymanymany.test: $(GROKOBJ)
predicates.test: $(GROKOBJ)
%.test: %.test.o
$(CC) $(LDFLAGS) $(CFLAGS) $(^:cleanobj=) -o $@
|