forked from vtest/VTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (66 loc) · 1.86 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
PYTHON2 ?= python2
PYTHON3 ?= python3
PYTHON ?= python
VARNISH_SRC ?= /home/phk/Varnish/trunk/varnish-cache
AWK ?= awk
SRCS= src/*.c \
lib/*.c
DEPS= ${SRCS} \
lib/*.h \
src/*.h \
src/tbl/*.h \
src/teken_state.h \
src/vtc_h2_dectbl.h
FLAGS= -O2 -s -Wall -Werror
INCS= -Isrc \
-Ilib \
-I/usr/local/include \
-pthread
LIBS= -L/usr/local/lib \
-lm \
-lpcre \
-lz
#######################################################################
# If you want to build vtest without varnish support, use this part:
vtest: ${DEPS}
${CC} \
${FLAGS} \
-o vtest \
${INCS} \
${SRCS} \
${LIBS}
test: vtest
env PATH=`pwd`:${PATH} vtest tests/*.vtc
#######################################################################
# ... other point to varnish source tree and use this part:
varnishtest: ${DEPS}
${CC} \
${FLAGS} \
-o varnishtest \
-DVTEST_WITH_VTC_VARNISH \
-DVTEST_WITH_VTC_LOGEXPECT \
${INCS} \
-I${VARNISH_SRC}/include \
${SRCS} \
${LIBS} \
-L${VARNISH_SRC}/lib/libvarnishapi/.libs \
-Wl,--rpath,${VARNISH_SRC}/lib/libvarnishapi/.libs \
-lvarnishapi
#######################################################################
src/vtc_h2_dectbl.h: src/huffman_gen.py src/tbl/vhp_huffman.h
@( echo trying python3 && \
${PYTHON3} src/huffman_gen.py src/tbl/vhp_huffman.h > $@ ) || \
( echo trying python2 instead && \
${PYTHON2} src/huffman_gen.py src/tbl/vhp_huffman.h > $@ ) || \
( echo trying python instead && \
${PYTHON} src/huffman_gen.py src/tbl/vhp_huffman.h > $@ ) || \
( echo failed && exit 1 )
#######################################################################
src/teken_state.h: src/gensequences src/sequences
${AWK} -f src/gensequences src/sequences > src/teken_state.h
#######################################################################
clean:
rm -f vtest varnishtest
rm -f src/teken_state.h
rm -f src/vtc_h2_dectbl.h