-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Makefile.am
229 lines (195 loc) · 6.55 KB
/
Makefile.am
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
bin_PROGRAMS = memcached
pkginclude_HEADERS = protocol_binary.h xxhash.h
noinst_PROGRAMS = memcached-debug sizes testapp timedrun
BUILT_SOURCES=
testapp_SOURCES = testapp.c util.c util.h stats_prefix.c stats_prefix.h jenkins_hash.c murmur3_hash.c hash.h cache.c crc32c.c
timedrun_SOURCES = timedrun.c
memcached_SOURCES = memcached.c memcached.h \
hash.c hash.h \
jenkins_hash.c jenkins_hash.h \
murmur3_hash.c murmur3_hash.h \
queue.h \
slabs.c slabs.h \
items.c items.h \
assoc.c assoc.h \
thread.c daemon.c \
stats_prefix.c stats_prefix.h \
util.c util.h \
trace.h cache.c cache.h sasl_defs.h \
bipbuffer.c bipbuffer.h \
base64.c base64.h \
logger.c logger.h \
crawler.c crawler.h \
itoa_ljust.c itoa_ljust.h \
slab_automove.c slab_automove.h \
authfile.c authfile.h \
restart.c restart.h \
proto_text.c proto_text.h \
proto_bin.c proto_bin.h
if BUILD_SOLARIS_PRIVS
memcached_SOURCES += solaris_priv.c
endif
if BUILD_LINUX_PRIVS
memcached_SOURCES += linux_priv.c
endif
if BUILD_OPENBSD_PRIVS
memcached_SOURCES += openbsd_priv.c
endif
if BUILD_FREEBSD_PRIVS
memcached_SOURCES += freebsd_priv.c
endif
if BUILD_DARWIN_PRIVS
memcached_SOURCES += darwin_priv.c
endif
if ENABLE_SASL
memcached_SOURCES += sasl_defs.c
endif
if ENABLE_PROXY
memcached_SOURCES += proto_proxy.c proto_proxy.h vendor/mcmc/mcmc.h \
proxy_xxhash.c proxy.h \
proxy_ustats.c \
proxy_ratelim.c \
proxy_jump_hash.c proxy_request.c \
proxy_result.c proxy_inspector.c \
proxy_mutator.c \
proxy_network.c proxy_lua.c \
proxy_luafgen.c \
proxy_config.c proxy_ring_hash.c \
proxy_internal.c \
proxy_tls.c proxy_tls.h \
md5.c md5.h \
vendor/routelib/routelib.h
endif
if ENABLE_EXTSTORE
memcached_SOURCES += extstore.c extstore.h \
crc32c.c crc32c.h \
storage.c storage.h \
slab_automove_extstore.c slab_automove_extstore.h
endif
if ENABLE_TLS
memcached_SOURCES += tls.c tls.h
endif
memcached_debug_SOURCES = $(memcached_SOURCES)
memcached_CPPFLAGS = -DNDEBUG
memcached_debug_LDADD = @PROFILER_LDFLAGS@
memcached_debug_CFLAGS = @PROFILER_FLAGS@
memcached_LDADD =
memcached_LDFLAGS =
memcached_debug_LDFLAGS =
memcached_DEPENDENCIES =
memcached_debug_DEPENDENCIES =
CLEANFILES=
if BUILD_LINUX_PRIVS
memcached_LDADD += -lseccomp
memcached_debug_LDADD += -lseccomp
endif
if BUILD_DTRACE
BUILT_SOURCES += memcached_dtrace.h
CLEANFILES += memcached_dtrace.h
endif
if DTRACE_INSTRUMENT_OBJ
memcached_LDADD += memcached_dtrace.o
memcached_DEPENDENCIES += memcached_dtrace.o
memcached_debug_LDADD += memcached_debug_dtrace.o
memcached_debug_DEPENDENCIES += memcached_debug_dtrace.o
CLEANFILES += memcached_dtrace.o memcached_debug_dtrace.o
endif
if ENABLE_PROXY
memcached_LDADD += vendor/lua/src/liblua.a vendor/mcmc/mcmc.o
memcached_debug_LDADD += vendor/lua/src/liblua.a vendor/mcmc/mcmc.o
memcached_LDFLAGS += -rdynamic
memcached_debug_LDFLAGS += -rdynamic
endif
if ENABLE_PROXY_URING
memcached_LDADD += vendor/liburing/src/liburing.a
memcached_debug_LDADD += vendor/liburing/src/liburing.a
endif
memcached_debug_CFLAGS += -DMEMCACHED_DEBUG
# build fails on Darwin with const signature replacements.
if DARWIN
memcached_dtrace.h: memcached_dtrace.d
${DTRACE} -h -s memcached_dtrace.d
else
memcached_dtrace.h: memcached_dtrace.d
${DTRACE} -h -s memcached_dtrace.d
sed -e 's,void \*,const void \*,' memcached_dtrace.h | \
sed -e 's,char \*,const char \*,g' | tr '\t' ' ' > mmc_dtrace.tmp
mv mmc_dtrace.tmp memcached_dtrace.h
endif
memcached_dtrace.o: $(memcached_OBJECTS)
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_dtrace.o -s ${srcdir}/memcached_dtrace.d $(memcached_OBJECTS)
memcached_debug_dtrace.o: $(memcached_debug_OBJECTS)
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_debug_dtrace.o -s ${srcdir}/memcached_dtrace.d $(memcached_debug_OBJECTS)
SUBDIRS = doc
DIST_DIRS = scripts
EXTRA_DIST = doc scripts t memcached.spec memcached_dtrace.d version.m4 README.md LICENSE.bipbuffer
EXTRA_DIST += vendor/Makefile vendor/lua/doc/* vendor/lua/Makefile vendor/lua/README
EXTRA_DIST += vendor/lua/src/*.c vendor/lua/src/*.h vendor/lua/src/Makefile
EXTRA_DIST += vendor/mcmc/LICENSE vendor/mcmc/Makefile vendor/mcmc/README.md vendor/mcmc/*.c vendor/mcmc/*.h
EXTRA_DIST += vendor/routelib/*.h vendor/routelib/*.lua
if ENABLE_PROXY
SUBDIRS += vendor
endif
MOSTLYCLEANFILES = *.gcov *.gcno *.gcda *.tcov
if ENABLE_TLS
test_tls:
$(MAKE) SSL_TEST=1 test
test_basic_tls:
@if test $(SSL_TEST)1 != 1; then \
echo "Running basic tests with TLS"; \
$(builddir)/testapp && \
prove $(srcdir)/t/binary.t $(srcdir)/t/getset.t $(srcdir)/t/ssl* && \
echo "Finished running basic TLS tests"; \
else \
echo "Set SSL_TEST=1 to enable TLS tests"; \
fi
endif
test: memcached-debug sizes testapp
$(builddir)/sizes
$(builddir)/testapp
if ENABLE_TLS
@if test $(SSL_TEST)1 = 1; then \
$(MAKE) SSL_TEST=1 test_basic_tls; \
fi
endif
@if test -n "${PARALLEL}"; then \
prove $(srcdir)/t -j ${PARALLEL}; \
else \
prove $(srcdir)/t; \
fi
@if test `basename $(PROFILER)` = "gcov"; then \
for file in memcached_debug-*.gc??; do \
mv -f $$file `echo $$file | sed 's/memcached_debug-//'`; \
done && \
for file in *.gcda; do \
srcfile=`echo $$file | sed 's/.gcda/.c/'`; \
if test -n "`echo $(memcached_debug_SOURCES) | grep $$srcfile`"; then \
echo `$(PROFILER) $$srcfile` | sed 's/'$$srcfile':.*//'; \
fi \
done \
elif test `basename $(PROFILER)` = "tcov"; then \
files=`grep SRCFILE memcached-debug.profile/tcovd | sed 's/SRCFILE://' | sort | uniq` && \
$(PROFILER) -x memcached-debug.profile $$files 2>&1; \
for file in *.tcov; do \
srcfile=`echo $$file | sed 's/.tcov//'`; \
if test -n "`echo $(memcached_debug_SOURCES) | grep $$srcfile`"; then \
echo $$srcfile : `grep 'Percent of the file executed' $$file`; \
fi \
done \
else :; fi
docs:
(cat Doxyfile ; echo "PROJECT_NUMBER=`cat version.num`") | doxygen -
dist-hook:
rm -f $(distdir)/*/*~ $(distdir)/t/lib/*~ $(distdir)/*~
maintainer-clean-local:
-rm Makefile.in
-rm aclocal.m4
-rm config.guess
-rm config.sub
-rm depcomp
-rm install-sh
-rm ltmain.sh
-rm missing
-rm configure
-rm config.log
-rm config.status