-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile.am
194 lines (157 loc) · 5.35 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
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4 --force
bin_PROGRAMS = moxi
noinst_PROGRAMS =
if BUILD_TESTAPPS
noinst_PROGRAMS += sizes testapp timedrun htgram_test
endif
BUILT_SOURCES =
testapp_SOURCES = testapp.c util.c util.h
moxi_SOURCES = memcached.c memcached.h \
genhash.c genhash.h genhash_int.h \
hash.c hash.h \
slabs.c slabs.h \
items.c items.h \
assoc.c assoc.h \
thread.c \
stats.c stats.h \
util.c util.h \
trace.h cache.h \
work.c work.h \
redirects.h \
cproxy.c cproxy.h \
cproxy_config.c \
cproxy_protocol_a.c \
cproxy_protocol_a2a.c \
cproxy_protocol_a2b.c \
cproxy_protocol_b.c \
cproxy_protocol_b2b.c \
cproxy_multiget.c \
cproxy_stats.c \
cproxy_front.c \
matcher.c matcher.h \
murmur_hash.c \
mcs.c mcs.h \
stdin_check.c stdin_check.h \
log.c log.h \
cJSON.c cJSON.h \
config_static.h \
htgram.c htgram.h
if BUILD_DAEMON
moxi_SOURCES += daemon.c
endif
timedrun_SOURCES = timedrun.c
htgram_test_SOURCES = htgram_test.c htgram.c htgram.h
TESTS = check_util check_moxi check_work
if HAVE_LIBCONFLATE
TESTS += check_moxi_agent
endif
check_PROGRAMS = check_util \
check_moxi \
check_work
if HAVE_LIBCONFLATE
check_PROGRAMS += check_moxi_agent
endif
test_moxi:
./t/moxi_all.pl
check_util_SOURCES = check_util.c util.c util.h
check_util_CFLAGS = @CHECK_CFLAGS@
check_util_LDADD = @CHECK_LIBS@
if BUILD_CACHE
moxi_SOURCES += cache.c
testapp_SOURCES += cache.c
endif
if HAVE_LIBCONFLATE
moxi_SOURCES += agent.h agent_config.c agent_ping.c agent_stats.c
endif
if BUILD_SOLARIS_PRIVS
moxi_SOURCES += solaris_priv.c
endif
moxi_CPPFLAGS = -DCONFLATE_DB_PATH=\"$(CONFLATE_DB_PATH)\"
moxi_LDADD =
moxi_LDFLAGS = $(LTLIBEVENT) $(LTLIBCONFLATE) $(LTLIBHASHKIT)
moxi_DEPENDENCIES =
if MOXI_USE_LIBVBUCKET
moxi_LDFLAGS += $(LTLIBVBUCKET)
endif
if MOXI_USE_LIBMEMCACHED
moxi_LDFLAGS += $(LTLIBMEMCACHED)
endif
CLEANFILES=
SUBDIRS = doc $(MAYBE_LIBCONFLATE)
DIST_SUBDIRS = doc $(MAYBE_LIBCONFLATE)
DIST_DIRS = scripts
EXTRA_DIST = doc scripts TODO t m4/version.m4 protocol_binary.h win32 debian TODO.moxi LICENSE Doxyfile HACKING
MOSTLYCLEANFILES = *.gcov *.gcno *.gcda *.tcov
memcached-debug: moxi
cp moxi memcached-debug
test: memcached-debug sizes testapp
$(srcdir)/sizes
$(srcdir)/testapp
./t/moxi_all.pl
test_gcov: test
@if test `basename $(PROFILER)` = "gcov"; then \
for file in moxi_debug-*.gc??; do \
mv -f $$file `echo $$file | sed 's/moxi_debug-//'`; \
done && \
for file in *.gcda; do \
srcfile=`echo $$file | sed 's/.gcda/.c/'`; \
if test -n "`echo $(moxi_debug_SOURCES) | grep $$srcfile`"; then \
echo `$(PROFILER) $$srcfile` | sed 's/'$$srcfile':.*//'; \
fi \
done \
elif test `basename $(PROFILER)` = "tcov"; then \
files=`grep SRCFILE moxi-debug.profile/tcovd | sed 's/SRCFILE://' | sort | uniq` && \
$(PROFILER) -x moxi-debug.profile $$files 2>&1; \
for file in *.tcov; do \
srcfile=`echo $$file | sed 's/.tcov//'`; \
if test -n "`echo $(moxi_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:
@if [ "x$(MAYBE_LIBCONFLATE)" = x ]; then \
echo "WARNING! WARNING! WARNING!: libconflate WILL NOT be bundled in distribution archive!"; \
echo "WARNING! WARNING! WARNING!: you should do 'make dist' after configuring with bundled libconflate (and libstrophe too)!!!!!"; \
fi
rm -rf $(distdir)/libmemcached-0.30/libmemcached/{.deps,.libs,*.lo,*.o,Makefile,*.la,libmemcached_config.h,stamp-h[0-9]}
rm -f $(distdir)/*/*~ $(distdir)/t/lib/*~ $(distdir)/*~
install-data-hook:
$(mkdir_p) $(DESTDIR)$(CONFLATE_DB_PATH)
check_work_SOURCES = check_work.c $(moxi_SOURCES)
check_work_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK
check_work_LDADD = @CHECK_LIBS@ $(moxi_LDADD)
check_moxi_SOURCES = check_moxi.c $(moxi_SOURCES)
check_moxi_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK
check_moxi_LDADD = @CHECK_LIBS@ $(moxi_LDADD)
if HAVE_LIBCONFLATE
check_moxi_agent_SOURCES = check_moxi_agent.c redirects.c $(moxi_SOURCES)
check_moxi_agent_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK -DREDIRECTS_FOR_MOCKS
check_moxi_agent_LDADD = @CHECK_LIBS@ $(moxi_LDADD)
endif
check-syntax:
$(COMPILE) $(moxi_CPPFLAGS) -o /dev/null -S ${CHK_SOURCES}
fc_rpm_inner:
-rm $(rpmtop)/SRPMS/moxi-$(VERSION)*.rpm
-rm $(rpmtop)/RPMS/*/moxi-$(VERSION)*.rpm
cp moxi-$(VERSION).tar.gz $(rpmtop)/SOURCES/
rpmbuild -ba scripts/rpm/moxi.spec
cp $(rpmtop)/SRPMS/moxi-$(VERSION)*.rpm .
cp $(rpmtop)/RPMS/*/moxi{,-debuginfo}-$(VERSION)*.rpm .
fc_rpm: dist
rpmtop=`rpm --eval "%{_topdir}"` $(MAKE) fc_rpm_inner
TMP_DIR=./tmp
TMP_VER=$(TMP_DIR)/version_num.tmp
version:
test -d $(TMP_DIR) || mkdir $(TMP_DIR)
git describe | sed s/-/_/g > $(TMP_VER)
bdist: version
rm -f ./moxi_*.tar.gz
rm -rf $(TMP_DIR)/moxi
mkdir $(TMP_DIR)/moxi
cp moxi $(TMP_DIR)/moxi
(cd $(TMP_DIR); tar cf - moxi) | gzip -9 > moxi_`cat $(TMP_VER)`-`uname -s`.`uname -m`.tar.gz
echo created moxi_`cat $(TMP_VER)`-`uname -s`.`uname -m`.tar.gz