-
Notifications
You must be signed in to change notification settings - Fork 103
/
Makefile.am
369 lines (308 loc) · 11.3 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# vim: set expandtab:
#
# Copyright 2010-2013 Couchbase, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Automake file used to build libcouchbase. Please avoid using propritary
# make constructs, but keep the syntax portable. To reduce the posibility
# for merge conflicts all list of files should be sorted aphabetically
# (If everyone always add their files to the end of the list that line will
# always result in a conflict..)
#
# @author Trond Norbye
#
ACLOCAL_AMFLAGS = -I m4 --force
lib_LTLIBRARIES = libcouchbase.la
noinst_LTLIBRARIES = libcbsasl.la
bin_PROGRAMS =
check_PROGRAMS =
noinst_PROGRAMS =
man_MANS = man/cbc.1 man/cbc-pillowfight.1 man/cbcrc.4
include man/manpages.mk
BUILT_SOURCES =
CLEANFILES = \
check-all-libev-unit-tests.log \
check-all-libevent-unit-tests.log \
check-all-libuv-unit-tests.log \
check-all-select-unit-tests.log
libcouchbase_la_CPPFLAGS =
libcouchbase_la_DEPENDENCIES =
libcouchbase_la_LIBADD =
libcouchbase_la_SOURCES =
include filelist.mk
if BUILD_TOOLS
if HAVE_CXX
bin_PROGRAMS += tools/cbc tools/cbc-pillowfight
check_PROGRAMS += tests/homebrew-acceptance-test
endif
endif
nobase_pkginclude_HEADERS = \
plugins/io/libuv/plugin-internal.h \
plugins/io/libuv/libuv_compat.h \
plugins/io/libuv/plugin-libuv.c
pkginclude_HEADERS += plugins/io/libuv/libuv_io_opts.h \
plugins/io/select/select_io_opts.h \
plugins/io/libev/libev_io_opts.h \
plugins/io/libevent/libevent_io_opts.h
libcbsasl_la_SOURCES = \
contrib/cbsasl/include/cbsasl/cbsasl.h \
contrib/cbsasl/include/cbsasl/visibility.h \
contrib/cbsasl/src/client.c \
contrib/cbsasl/src/common.c \
contrib/cbsasl/src/config.h \
contrib/cbsasl/src/cram-md5/hmac.c \
contrib/cbsasl/src/cram-md5/hmac.h \
contrib/cbsasl/src/cram-md5/md5.c \
contrib/cbsasl/src/cram-md5/md5.h \
contrib/cbsasl/src/util.h
libcbsasl_la_CFLAGS = $(AM_NOWARN_CFLAGS)
libcbsasl_la_CPPFLAGS = $(AM_NOWARN_CPPFLAGS) -DBUILDING_CBSASL=1 -I${top_srcdir}/contrib/cbsasl/src
libcouchbase_la_LDFLAGS= $(AM_LDFLAGS) -version-info $(API_CURRENT):$(API_REVISION):$(API_AGE) -no-undefined $(AM_PROFILE_SOLDFLAGS)
libcouchbase_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS) -DLIBCOUCHBASE_INTERNAL=1 -DLCB_LIBDIR="\"${libdir}\""
libcouchbase_la_LIBADD += libcbsasl.la liblcbht.la
libcouchbase_la_DEPENDENCIES += libcbsasl.la liblcbht.la
if ENABLE_SSL
libcouchbase_la_LDFLAGS+=$(OPENSSL_LDFLAGS)
libcouchbase_la_CPPFLAGS+=$(OPENSSL_INCLUDES)
libcouchbase_la_LIBADD+=liblcbssl.la $(OPENSSL_LIBS)
libcouchbase_la_DEPENDENCIES+=liblcbssl.la
endif
if !ENABLE_SSL
libcouchbase_la_CPPFLAGS+=-DLCB_NO_SSL
endif
if ENABLE_SNAPPY
if BUILD_STATIC_SNAPPY
libcouchbase_la_SOURCES += config/dummy-cxx.cc
else
libcouchbase_la_CPPFLAGS += $(SNAPPY_INCLUDES)
libcouchbase_la_LDFLAGS += $(SNAPPY_LDFLAGS)
libcouchbase_la_LIBADD += -lsnappy
if HAVE_CXX
if HAVE_GOOGLETEST_SRC
tests_mc_tests_LDADD += -lsnappy
tests_mc_tests_LDFLAGS += $(SNAPPY_LDFLAGS)
endif
endif
endif
else
libcouchbase_la_CPPFLAGS += -DLCB_NO_SNAPPY=1
endif
if ENABLE_DTRACE
BUILT_SOURCES += src/probes.h
CLEANFILES += src/probes.h
src/probes.h: src/probes.d
$(DTRACE) -C -h -s $< -o $@
probes.o: src/probes.d
$(DTRACE) -C $(DTRACE_DASH_G) -s $< -o $@
probes.lo: probes.o
$(AM_V_GEN)printf %s\\n \
'# $@ - a libtool object file' \
'# Generated by libtool (GNU libtool) 2.4' \
'# Actually generated by Makefile.am, in order to shut up libtool' \
"pic_object='$<'" \
"non_pic_object='$<'" \
> $@
if DTRACE_INSTRUMENT_OBJECT
# We need to change the name from src/libcouchbase_la-fname.lo to
# src/.libs/libcouchbase_la-fname.o ;)
LIBCOUCHBASE_OBJS=$(libcouchbase_la_OBJECTS:%lo=%o)
LIBCOUCHBASE_OBJECTS=$(LIBCOUCHBASE_OBJS:src%=src/.libs%)
src/libcouchbase_la-probes.lo: $(libcouchbase_la_OBJECTS) src/probes.h
$(DTRACE) $(DTRACEFLAGS) -C -G \
-o src/.libs/libcouchbase_la-probes.o \
-s ${srcdir}/src/probes.d \
$(LIBCOUCHBASE_OBJECTS)
@$(DTRACE) $(DTRACEFLAGS) -C -G \
-o src/libcouchbase_la-probes.o \
-s ${srcdir}/src/probes.d \
$(LIBCOUCHBASE_OBJS) 2>/dev/null || /bin/true
sed -e s,instance,probes,g src/libcouchbase_la-instance.lo > src/libcouchbase_la-probes.lo
libcouchbase_la_DEPENDENCIES += src/libcouchbase_la-probes.lo
libcouchbase_la_LIBADD += src/libcouchbase_la-probes.lo
else
if !APPLE_DTRACE
libcouchbase_la_DEPENDENCIES += probes.lo
libcouchbase_la_LIBADD += probes.lo
endif
endif
endif
if HAVE_WINSOCK2
libcouchbase_la_CPPFLAGS += -Iwin32 -Iplugins/io/iocp -DWINVER=0x0600 -D_WIN32_WINNT=0x0600
endif
if HAVE_LIBEVENT
lib_LTLIBRARIES += libcouchbase_libevent.la
libcouchbase_libevent_la_SOURCES = plugins/io/libevent/plugin-libevent.c
libcouchbase_libevent_la_LDFLAGS=-avoid-version $(AM_LDFLAGS) $(AM_PROFILE_SOLDFLAGS)
libcouchbase_libevent_la_LIBADD=-levent
libcouchbase_libevent_la_CPPFLAGS=$(AM_CPPFLAGS) $(CPPFLAGS) -DLIBCOUCHBASE_INTERNAL=1
if BUILD_EXAMPLES
if HAVE_LIBEVENT2
noinst_PROGRAMS += example/libeventdirect/eventloop
endif
endif
endif
if HAVE_LIBEV
lib_LTLIBRARIES += libcouchbase_libev.la
libcouchbase_libev_la_SOURCES = plugins/io/libev/plugin-libev.c
libcouchbase_libev_la_LDFLAGS=-avoid-version $(AM_LDFLAGS) $(AM_PROFILE_SOLDFLAGS)
libcouchbase_libev_la_LIBADD=-lev
libcouchbase_libev_la_CPPFLAGS=$(AM_CPPFLAGS) $(CPPFLAGS) -DLIBCOUCHBASE_INTERNAL=1
endif
if HAVE_LIBUV
lib_LTLIBRARIES += libcouchbase_libuv.la
libcouchbase_libuv_la_SOURCES = plugins/io/libuv/plugin-libuv.c
libcouchbase_libuv_la_LDFLAGS = $(AM_PROFILE_SOLDFLAGS)
libcouchbase_libuv_la_LIBADD = -luv
libcouchbase_libuv_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) -DLIBCOUCHBASE_INTERNAL=1
endif
gtest-1.7.0.zip:
@echo "+--------------------------------+"
@echo "| Download Google test framework |"
@echo "+--------------------------------+"
${DOWNLOAD} gtest-1.7.0.zip http://googletest.googlecode.com/files/gtest-1.7.0-rc1.zip
if HAVE_CXX
if HAVE_GOOGLETEST_SRC
noinst_LTLIBRARIES += libgtest.la
libgtest_la_SOURCES = tests/gtest-sources.cc
libgtest_la_CPPFLAGS = $(AM_NOWARN_CPPFLAGS) -I$(GTEST_ROOT) -I$(GTEST_ROOT)/include
libgtest_la_CXXFLAGS = $(AM_NOWARN_CXXFLAGS)
endif
endif
if DOWNLOAD_GTEST
gtest-1.7.0: gtest-1.7.0.zip
${UNZIP} -o -qq gtest-1.7.0.zip
BUILT_SOURCES += gtest-1.7.0
endif
distclean-local:
@rm -rf gtest-1.7.0
@rm -rf check-all*.log
$(MAKE) -f doc/Makefile clean || true
distcleancheck:
@:
doc-public:
$(MAKE) -f doc/Makefile public
doc-internal:
$(MAKE) -f doc/Makefile internal
if !HAVE_GOOGLETEST_SRC
endif
tests/CouchbaseMock.jar:
@echo "+---------------------------------------------+"
@echo "| Download CouchbaseMock for functional tests |"
@echo "+---------------------------------------------+"
${DOWNLOAD} tests/CouchbaseMock.jar http://files.couchbase.com/maven2/org/couchbase/mock/CouchbaseMock/0.8-SNAPSHOT/CouchbaseMock-0.8-20140621.030439-1.jar
example_minimal_minimal_SOURCES = example/minimal/minimal.c
example_minimal_minimal_DEPENDENCIES = libcouchbase.la
example_minimal_minimal_LDADD = libcouchbase.la
example_observe_observe_SOURCES = example/observe/observe.c
example_observe_observe_DEPENDENCIES = libcouchbase.la
example_observe_observe_LDADD = libcouchbase.la
example_db_db_SOURCES = example/db/db.c
example_db_db_DEPENDENCIES = libcouchbase.la
example_db_db_LDADD = libcouchbase.la
example_db_vb_SOURCES = example/db/vb.c
example_db_vb_DEPENDENCIES = libcouchbase.la
example_db_vb_LDADD = libcouchbase.la
example_libeventdirect_eventloop_SOURCES = example/libeventdirect/main.c
example_libeventdirect_eventloop_DEPENDENCIES = libcouchbase.la
example_libeventdirect_eventloop_LDADD = libcouchbase.la -levent
if HAVE_CXX
noinst_PROGRAMS += example/instancepool/instancepool
example_instancepool_instancepool_SOURCES = example/instancepool/pool.cc \
example/instancepool/pool.h \
example/instancepool/main.cc
example_instancepool_instancepool_DEPENDENCIES = libcouchbase.la
example_instancepool_instancepool_LDADD = libcouchbase.la -lpthread
noinst_PROGRAMS += example/mcc/mcc
example_mcc_mcc_SOURCES = example/mcc/mcc.cc
example_mcc_mcc_DEPENDENCIES = libcouchbase.la
example_mcc_mcc_LDADD = libcouchbase.la
endif
#
# Example programs using the library
#
if BUILD_EXAMPLES
noinst_PROGRAMS += \
example/db/db \
example/db/vb \
example/minimal/minimal \
example/observe/observe
if HAVE_LIBYAJL2
noinst_PROGRAMS += example/yajl/couchview
endif
endif
example_yajl_couchview_SOURCES = example/yajl/couchview.c
example_yajl_couchview_LDADD = libcouchbase.la -lyajl
if BUILD_TESTS
check_PROGRAMS += tests/check-all
endif
tests_check_all_SOURCES = tests/check-all.cc tests/mocksupport/procutil.c
tests_check_all_CPPFLAGS = $(AM_CPPFLAGS) -I"${srcdir}/tools"
tests_check_all_LDADD = libcouchbase.la libcliopts.la
tools_cbc_SOURCES = tools/cbc.cc tools/cbc-handlers.h
tools_cbc_LDADD = libcouchbase.la liblcbtools.la libcliopts.la
tools_cbc_pillowfight_SOURCES = tools/cbc-pillowfight.cc
tools_cbc_pillowfight_LDADD = libcouchbase.la liblcbtools.la libcliopts.la liblcbutils.la -lpthread
TESTS_ENVIRONMENT = export outdir="$(top_builddir)/tests";
TESTS =
if BUILD_TESTS
TESTS += tests/check-all
endif
if BUILD_TOOLS
if HAVE_CXX
TESTS += tests/homebrew-acceptance-test
endif
endif
if BUILD_TOOLS
CBC_LINKS = \
cbc-admin \
cbc-cat \
cbc-bucket-create \
cbc-bucket-delete \
cbc-cp \
cbc-create \
cbc-mcflush \
cbc-hash \
cbc-lock \
cbc-rm \
cbc-stats \
cbc-unlock \
cbc-verify \
cbc-verbosity \
cbc-version \
cbc-view
install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(RM) $(CBC_LINKS) && \
for f in $(CBC_LINKS); do $(LN_S) cbc$(EXEEXT) $$f$(EXEEXT); done
uninstall-local:
cd $(DESTDIR)$(bindir) && $(RM) $(CBC_LINKS)
endif
EXTRA_DIST += LICENSE README.markdown \
RELEASE_NOTES.markdown \
include/libcouchbase/configuration.h.in \
include/memcached/README include/memcached/COPYING \
tests/start_mock.sh \
win32 \
VERSION src/probes.d \
$(man_MANS)
if HAVE_DOXYGEN
endif
LINTFLAGS=-Iinclude -b -c -errchk=%all \
-erroff=E_INCL_NUSD,E_CAST_INT_TO_SMALL_INT,E_PTRDIFF_OVERFLOW \
-errtags=yes -errhdr=%user \
-errsecurity=extended -fd -Ncheck=%all -Nlevel=4 -n -Xc99=none
lint:
$(LINT.c) $(libcouchbase_la_SOURCES)
sinclude packaging/*/package.mk