-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
193 lines (130 loc) · 2.97 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
## Autotools settings
ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-cmocka \
--enable-examples
## File listings
EXTRA_DIST = \
autogen.sh \
.version \
build-aux/git-version-gen \
README.md
CLEANFILES =
BUILT_SOURCES = \
.version
include_HEADERS = \
include/balde-utils.h
pkginclude_HEADERS = \
include/balde-utils/string_utils.h \
include/balde-utils/slist.h \
include/balde-utils/trie.h
noinst_HEADERS =
lib_LTLIBRARIES = \
src/libbalde_utils.la
noinst_LTLIBRARIES =
noinst_PROGRAMS =
check_PROGRAMS =
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = balde-utils.pc
## Build rules: libbalde_utils
src_libbalde_utils_la_SOURCES = \
src/string_utils.c \
src/slist.c \
src/trie.c
src_libbalde_utils_la_CFLAGS = \
$(AM_CFLAGS) \
-I$(top_srcdir)/include
src_libbalde_utils_la_LIBADD =
src_libbalde_utils_la_LDFLAGS = \
-version-info $(LIBBALDE_UTILS_LT_VERSION_INFO)
## Build rules: examples
if BUILD_EXAMPLES
noinst_PROGRAMS +=
#examples_hello_SOURCES = \
# examples/hello.c
#examples_hello_CFLAGS = \
# -I$(top_srcdir)/include
#examples_hello_LDFLAGS = \
# -no-install
#examples_hello_LDADD= \
# src/libbalde_utils.la
endif
## Build rules: tests
if USE_CMOCKA
check_PROGRAMS += \
tests/check_string_utils \
tests/check_slist \
tests/check_trie
tests_check_string_utils_SOURCES = \
tests/check_string_utils.c
tests_check_string_utils_CFLAGS = \
$(CMOCKA_CFLAGS) \
-I$(top_srcdir)/include
tests_check_string_utils_LDFLAGS = \
-no-install
tests_check_string_utils_LDADD = \
$(CMOCKA_LIBS) \
src/libbalde_utils.la
tests_check_slist_SOURCES = \
tests/check_slist.c
tests_check_slist_CFLAGS = \
$(CMOCKA_CFLAGS) \
-I$(top_srcdir)/include
tests_check_slist_LDFLAGS = \
-no-install
tests_check_slist_LDADD = \
$(CMOCKA_LIBS) \
src/libbalde_utils.la
tests_check_trie_SOURCES = \
tests/check_trie.c
tests_check_trie_CFLAGS = \
$(CMOCKA_CFLAGS) \
-I$(top_srcdir)/include
tests_check_trie_LDFLAGS = \
-no-install
tests_check_trie_LDADD = \
$(CMOCKA_LIBS) \
src/libbalde_utils.la
endif
TESTS = \
$(check_PROGRAMS)
## Helpers: Valgrind runners
if USE_VALGRIND
valgrind: all
$(MAKE) check TESTS_ENVIRONMENT=" \
$(VALGRIND) \
--tool=memcheck \
--leak-check=full \
--leak-resolution=high \
--num-callers=20 \
--show-possibly-lost=no"
valgrind-ci: all clean-local
$(MAKE) check TESTS_ENVIRONMENT=" \
$(VALGRIND) \
--tool=memcheck \
--xml=yes \
--xml-file=valgrind-%p.xml \
--leak-check=full \
--leak-resolution=high \
--num-callers=20 \
--show-possibly-lost=no"
endif
# Helpers: Git version
.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
# Helpers: Cleanup of helper files
clean-local:
-rm -rf valgrind-*.xml
# Helpers: Documentation
if BUILD_DOCS
#doxygen: clean-local Doxyfile
# $(DOXYGEN) Doxyfile
if PUBLISH_DOCS
#publish_docs: doxygen
# $(GITHUB_PAGES_PUBLISH) --verbose \
# --cname docs.balde.io \
# . doc/build/html
endif
endif