forked from couchbaselabs/libcbio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
84 lines (71 loc) · 2.89 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
#
# Copyright 2012 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.
#
ACLOCAL_AMFLAGS = -I m4 --force
lib_LTLIBRARIES = libcbio.la
pkginclude_HEADERS = \
include/libcbio/cbio.h \
include/libcbio/types.h \
include/libcbio/visibility.h
libcbio_la_CPPFLAGS = $(AM_CPPFLAGS) -DLIBCBIO_INTERNAL=1
libcbio_la_SOURCES = src/document.c src/error.c src/instance.c src/internal.h
libcbio_la_LDFLAGS = $(AM_LDFLAGS) $(AM_PROFILE_C_LDFLAGS) -lcouchstore \
-version-info $(LIBCBIO_API_CURRENT):$(LIBCBIO_API_REVISION):$(LIBCBIO_API_AGE) -no-undefined
check_PROGRAMS =
if HAVE_GOOGLETEST
check_PROGRAMS += tests/cbio_unit_tests
endif
TESTS=${check_PROGRAMS}
tests_cbio_unit_tests_SOURCES = tests/cbio_unit_tests.cc \
tests/document_unit_tests.cc \
tests/instance_unit_tests.cc
tests_cbio_unit_tests_DEPENDENCIES = libcbio.la
tests_cbio_unit_tests_LDFLAGS = $(AM_PROFILE_CXX_LDFLAGS) -lgtest libcbio.la
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) $(libcbio_la_SOURCES)
VALGRIND=valgrind
VALGRIND_OPTIONS=--tool=Memcheck --num-callers=50 \
--error-limit=yes --track-origins=yes --malloc-fill=55 \
--free-fill=aa --dsymutil=yes -q
VALGRIND_TEST=tests/.libs/cbio_unit_tests
valgrind: ${check_PROGRAMS}
@for f in $(VALGRIND_TEST); \
do \
LD_LIBRARY_PATH=`pwd`/.libs \
DYLD_LIBRARY_PATH=`pwd`/.libs \
echo Running Valgrind on $$f; \
$(VALGRIND) $(VALGRIND_OPTIONS) --log-file=`basename $$f`.log $$f; \
done
reformat:
astyle --mode=c \
--quiet \
--style=1tbs \
--indent=spaces=4 \
--indent-namespaces \
--indent-col1-comments \
--max-instatement-indent=78 \
--pad-oper \
--pad-header \
--add-brackets \
--unpad-paren \
--align-pointer=name \
--align-reference=name \
$(top_srcdir)/include/libcbio/*.[ch] \
$(top_srcdir)/src/*.[ch] \
$(top_srcdir)/tests/*.[ch][ch]