src/common: use single Makefile for parallel builds
[lttng-tools.git] / src / common / Makefile.am
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 AUTOMAKE_OPTIONS = subdir-objects
4 noinst_LTLIBRARIES =
5
6 BUILT_SOURCES =
7
8 noinst_HEADERS = \
9 align.h \
10 bug.h \
11 defaults.h \
12 error.h \
13 futex.h \
14 lttng-kernel.h \
15 lttng-kernel-old.h \
16 macros.h \
17 time.h \
18 uri.h \
19 utils.h
20
21
22 # libargpar
23 noinst_LTLIBRARIES += libargpar.la
24 libargpar_la_SOURCES = \
25 argpar/argpar.c \
26 argpar/argpar.h
27
28
29 # libargpar-utils
30 noinst_LTLIBRARIES += libargpar-utils.la
31 libargpar_utils_la_SOURCES = \
32 argpar-utils/argpar-utils.cpp \
33 argpar-utils/argpar-utils.h
34
35
36 # libbytecode
37 noinst_LTLIBRARIES += libbytecode.la
38 libbytecode_la_SOURCES = \
39 bytecode/bytecode.cpp \
40 bytecode/bytecode.h
41
42
43 # The libcommon-lgpl static archive contains only LGPLv2.1 code. It is
44 # meant to be used by LGPLv2.1 libraries such as liblttng-ctl. It also
45 # contains libcommon-lgpl.la.
46
47 noinst_LTLIBRARIES += libcommon-lgpl.la
48 libcommon_lgpl_la_SOURCES = \
49 actions/action.cpp \
50 actions/list.cpp \
51 actions/notify.cpp \
52 actions/path.cpp \
53 actions/rotate-session.cpp \
54 actions/snapshot-session.cpp \
55 actions/start-session.cpp \
56 actions/stop-session.cpp \
57 actions/rate-policy.cpp \
58 buffer-view.h buffer-view.cpp \
59 conditions/buffer-usage.cpp \
60 conditions/condition.cpp \
61 conditions/event-rule-matches.cpp \
62 conditions/session-consumed-size.cpp \
63 conditions/session-rotation.cpp \
64 credentials.cpp credentials.h \
65 defaults.cpp \
66 domain.cpp \
67 dynamic-array.cpp dynamic-array.h \
68 dynamic-buffer.cpp dynamic-buffer.h \
69 endpoint.cpp \
70 error.cpp error.h \
71 error-query.cpp \
72 evaluation.cpp \
73 event-expr/event-expr.cpp \
74 event-field-value.cpp \
75 event-rule/event-rule.cpp \
76 event-rule/kernel-kprobe.cpp \
77 event-rule/kernel-syscall.cpp \
78 event-rule/kernel-uprobe.cpp \
79 event-rule/kernel-tracepoint.cpp \
80 event-rule/user-tracepoint.cpp \
81 event-rule/log4j-logging.cpp \
82 event-rule/jul-logging.cpp \
83 event-rule/python-logging.cpp \
84 fd-handle.cpp fd-handle.h \
85 kernel-probe.cpp \
86 location.cpp \
87 log-level-rule.cpp \
88 mi-lttng.cpp mi-lttng.h \
89 notification.cpp \
90 payload.cpp payload.h \
91 payload-view.cpp payload-view.h \
92 readwrite.cpp readwrite.h \
93 runas.cpp runas.h \
94 session-descriptor.cpp \
95 snapshot.cpp snapshot.h \
96 spawn-viewer.cpp spawn-viewer.h \
97 thread.cpp thread.h \
98 time.cpp \
99 tracker.cpp tracker.h \
100 trigger.cpp \
101 unix.cpp unix.h \
102 uri.cpp uri.h \
103 userspace-probe.cpp \
104 utils.cpp utils.h
105
106 if HAVE_ELF_H
107 libcommon_lgpl_la_SOURCES += \
108 lttng-elf.cpp lttng-elf.h
109 endif
110
111 libcommon_lgpl_la_LIBADD = \
112 libbytecode.la \
113 libcompat.la \
114 libconfig.la \
115 libfilter.la \
116 libhashtable-lgpl.la \
117 $(top_builddir)/src/vendor/msgpack/libmsgpack.la
118
119
120 # The libpath static archive contains GPLv2 compatible code. It is
121 # meant to be used by GPL executables.
122 noinst_LTLIBRARIES += libpath.la
123 libpath_la_SOURCES = \
124 path.cpp path.h
125
126
127 # The libcommon-gpl static archive contains GPLv2 compatible code. It is
128 # meant to be used by GPL executables.
129 noinst_LTLIBRARIES += libcommon-gpl.la
130 libcommon_gpl_la_SOURCES = \
131 common.h \
132 context.cpp context.h \
133 daemonize.cpp daemonize.h \
134 event.cpp \
135 filter.cpp filter.h \
136 fs-handle.cpp fs-handle.h fs-handle-internal.h \
137 futex.cpp futex.h \
138 index-allocator.cpp index-allocator.h \
139 optional.h \
140 pipe.cpp pipe.h \
141 shm.cpp shm.h \
142 trace-chunk.cpp trace-chunk.h \
143 trace-chunk-registry.h \
144 uuid.cpp uuid.h \
145 waiter.cpp waiter.h
146
147 libcommon_gpl_la_LIBADD = \
148 libcommon-lgpl.la \
149 libpath.la \
150 libini-config.la \
151 libhashtable-gpl.la \
152 libfd-tracker.la
153
154
155 # libcompat
156 noinst_LTLIBRARIES += libcompat.la
157 libcompat_la_SOURCES = \
158 compat/compat-fcntl.cpp \
159 compat/directory-handle.cpp \
160 compat/directory-handle.h \
161 compat/dirent.h \
162 compat/endian.h \
163 compat/errno.h \
164 compat/fcntl.h \
165 compat/getenv.h \
166 compat/mman.h \
167 compat/netdb.h \
168 compat/path.h \
169 compat/paths.h \
170 compat/poll.cpp \
171 compat/poll.h \
172 compat/pthread.h \
173 compat/socket.h \
174 compat/string.h \
175 compat/tid.h \
176 compat/time.h
177
178
179 # libconfig
180 noinst_LTLIBRARIES += libconfig.la
181 libconfig_la_SOURCES = \
182 config/config-internal.h \
183 config/config-session-abi.h \
184 config/session-config.cpp \
185 config/session-config.h
186
187 libconfig_la_CPPFLAGS = $(libxml2_CFLAGS) $(AM_CPPFLAGS)
188 libconfig_la_LIBADD = ${libxml2_LIBS}
189
190
191 if BUILD_LIB_CONSUMER
192 noinst_LTLIBRARIES += libconsumer.la
193
194 libconsumer_la_SOURCES = \
195 consumer/consumer.cpp \
196 consumer/consumer.h \
197 consumer/consumer-metadata-cache.cpp \
198 consumer/consumer-metadata-cache.h \
199 consumer/consumer-stream.cpp \
200 consumer/consumer-stream.h \
201 consumer/consumer-testpoint.h \
202 consumer/consumer-timer.cpp \
203 consumer/consumer-timer.h \
204 consumer/metadata-bucket.cpp \
205 consumer/metadata-bucket.h
206
207 libconsumer_la_LIBADD = \
208 libkernel-consumer.la \
209 librelayd.la \
210 libsessiond-comm.la
211
212 if HAVE_LIBLTTNG_UST_CTL
213 libconsumer_la_LIBADD += \
214 libust-consumer.la
215 endif
216 endif # BUILD_LIB_CONSUMER
217
218
219 # libfd-tracker
220 noinst_LTLIBRARIES += libfd-tracker.la
221 libfd_tracker_la_SOURCES = \
222 fd-tracker/fd-tracker.cpp \
223 fd-tracker/fd-tracker.h \
224 fd-tracker/inode.cpp \
225 fd-tracker/inode.h \
226 fd-tracker/utils.cpp \
227 fd-tracker/utils.h \
228 fd-tracker/utils-poll.cpp
229
230
231 # libfilter
232 noinst_LTLIBRARIES += libfilter.la
233
234 libfilter_la_SOURCES = \
235 filter/filter-ast.h \
236 filter/filter-ir.h \
237 filter/filter-lexer.lpp \
238 filter/filter-parser.ypp \
239 filter/filter-symbols.h \
240 filter/filter-visitor-generate-bytecode.cpp \
241 filter/filter-visitor-generate-ir.cpp \
242 filter/filter-visitor-ir-check-binary-op-nesting.cpp \
243 filter/filter-visitor-ir-normalize-glob-patterns.cpp \
244 filter/filter-visitor-ir-validate-globbing.cpp \
245 filter/filter-visitor-ir-validate-string.cpp \
246 filter/filter-visitor-xml.cpp \
247 filter/memstream.h
248
249 BUILT_SOURCES += filter/filter-parser.hpp
250
251 libfilter_la_CXXFLAGS = -include filter-symbols.h $(AM_CXXFLAGS)
252 libfilter_la_CPPFLAGS = -I$(srcdir)/filter -I$(builddir)/filter $(AM_CPPFLAGS)
253 libfilter_la_LIBADD = libstring-utils.la
254
255 AM_YFLAGS = -t -d -v -Wno-yacc
256
257 # start with empty files to clean
258 CLEANFILES =
259
260 if HAVE_BISON
261 # we have bison: we can clean the generated parser files
262 CLEANFILES += \
263 filter/filter-parser.cpp \
264 filter/filter-parser.hpp \
265 filter/filter-parser.output
266 else # HAVE_BISON
267 # create target used to stop the build if we want to build the parser,
268 # but we don't have the necessary tool to do so
269 filter/filter-parser.cpp filter/filter-parser.hpp: filter/filter-parser.ypp
270 @echo "Error: Cannot build target because bison is missing."
271 @echo "Make sure bison is installed and run the configure script again."
272 @false
273
274 BUILT_SOURCES += filter/filter-parser.cpp filter/filter-parser.hpp
275 endif # HAVE_BISON
276
277 if HAVE_FLEX
278 # we have flex: we can clean the generated lexer files
279 CLEANFILES += filter/filter-lexer.cpp
280 else # HAVE_FLEX
281 # create target used to stop the build if we want to build the lexer,
282 # but we don't have the necessary tool to do so
283 filter/filter-lexer.cpp: filter/filter-lexer.lpp
284 @echo "Error: Cannot build target because flex is missing."
285 @echo "Make sure flex is installed and run the configure script again."
286 @false
287
288 BUILT_SOURCES += filter/filter-lexer.cpp
289 endif # HAVE_FLEX
290
291
292 noinst_LTLIBRARIES += libhashtable-lgpl.la
293 libhashtable_lgpl_la_SOURCES = \
294 hashtable/seed.cpp \
295 hashtable/utils.cpp \
296 hashtable/utils.h
297
298
299 noinst_LTLIBRARIES += libhashtable-gpl.la
300 libhashtable_gpl_la_SOURCES = \
301 hashtable/hashtable.cpp \
302 hashtable/hashtable.h \
303 hashtable/hashtable-symbols.h
304
305 libhashtable_gpl_la_LIBADD = \
306 $(URCU_LIBS) \
307 $(URCU_CDS_LIBS)
308
309
310 if BUILD_LIB_HEALTH
311 noinst_LTLIBRARIES += libhealth.la
312
313 libhealth_la_SOURCES = \
314 health/health.cpp
315 endif
316
317
318 # libini-config
319 noinst_LTLIBRARIES += libini-config.la
320 libini_config_la_SOURCES = \
321 ini-config/ini.cpp \
322 ini-config/ini.h \
323 ini-config/ini-config.cpp \
324 ini-config/ini-config.h
325
326
327 if BUILD_LIB_INDEX
328 noinst_LTLIBRARIES += libindex.la
329
330 libindex_la_SOURCES = \
331 index/ctf-index.h \
332 index/index.cpp \
333 index/index.h
334 endif
335
336
337 if BUILD_LIB_KERNEL_CTL
338 noinst_LTLIBRARIES += libkernel-ctl.la
339
340 libkernel_ctl_la_SOURCES = \
341 kernel-ctl/kernel-ctl.cpp \
342 kernel-ctl/kernel-ctl.h \
343 kernel-ctl/kernel-ioctl.h
344 endif
345
346 if BUILD_LIB_SESSIOND_COMM
347 noinst_LTLIBRARIES += libsessiond-comm.la
348
349 libsessiond_comm_la_SOURCES = \
350 sessiond-comm/agent.h \
351 sessiond-comm/inet.cpp \
352 sessiond-comm/inet.h \
353 sessiond-comm/inet6.cpp \
354 sessiond-comm/inet6.h \
355 sessiond-comm/relayd.h \
356 sessiond-comm/sessiond-comm.cpp \
357 sessiond-comm/sessiond-comm.h
358 endif
359
360 if BUILD_LIB_RELAYD
361 noinst_LTLIBRARIES += librelayd.la
362
363 librelayd_la_SOURCES = \
364 relayd/relayd.cpp \
365 relayd/relayd.h
366
367 librelayd_la_LIBADD = libsessiond-comm.la
368 endif
369
370
371 if BUILD_LIB_KERNEL_CONSUMER
372 noinst_LTLIBRARIES += libkernel-consumer.la
373
374 libkernel_consumer_la_SOURCES = \
375 kernel-consumer/kernel-consumer.cpp \
376 kernel-consumer/kernel-consumer.h
377
378 libkernel_consumer_la_LIBADD = \
379 libkernel-ctl.la
380 endif
381
382 if BUILD_LIB_UST_CONSUMER
383 if HAVE_LIBLTTNG_UST_CTL
384 noinst_LTLIBRARIES += libust-consumer.la
385
386 libust_consumer_la_SOURCES = \
387 ust-consumer/ust-consumer.cpp \
388 ust-consumer/ust-consumer.h
389
390 libust_consumer_la_LIBADD = \
391 $(UST_CTL_LIBS)
392 endif
393 endif
394
395 if BUILD_LIB_TESTPOINT
396 noinst_LTLIBRARIES += libtestpoint.la
397
398 libtestpoint_la_SOURCES = \
399 testpoint/testpoint.cpp \
400 testpoint/testpoint.h
401
402 libtestpoint_la_LIBADD = $(DL_LIBS)
403 endif
404
405
406 # libstring-utils
407 noinst_LTLIBRARIES += libstring-utils.la
408 libstring_utils_la_SOURCES = \
409 string-utils/format.h \
410 string-utils/string-utils.cpp \
411 string-utils/string-utils.h
412
413
414 noinst_PROGRAMS = filter-grammar-test
415 filter_grammar_test_SOURCES = filter-grammar-test.cpp
416 filter_grammar_test_LDADD = libcommon-gpl.la
417
418 EXTRA_DIST = \
419 mi-lttng-4.1.xsd \
420 session.xsd
421
422 xmldir = $(datadir)/xml/lttng
423 dist_xml_DATA = session.xsd
424
425 # Copy EXTRA_DIST files to the build directory
426 all-local:
427 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
428 for script in $(EXTRA_DIST); do \
429 cp -f $(srcdir)/$$script $(builddir); \
430 done; \
431 fi
432
433 clean-local:
434 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
435 for script in $(EXTRA_DIST); do \
436 rm -f $(builddir)/$$script; \
437 done; \
438 fi
This page took 0.037662 seconds and 4 git commands to generate.