xref: /openbmc/libmctp/Makefile.am (revision b3de343e)
1ACLOCAL_AMFLAGS = -I m4
2
3lib_LTLIBRARIES = libmctp.la
4libmctp_la_SOURCES = core.c alloc.c log.c \
5		     libmctp-alloc.h libmctp-log.h \
6		     libmctp-cmds.h
7include_HEADERS = libmctp.h
8
9if LIBMCTP_BINDING_serial
10libmctp_la_SOURCES += serial.c crc-16-ccitt.c
11include_HEADERS += libmctp-serial.h
12endif
13
14if LIBMCTP_BINDING_astlpc
15libmctp_la_SOURCES += astlpc.c crc32.c
16include_HEADERS += libmctp-astlpc.h
17endif
18
19if HAVE_SYSTEMD
20systemdsystemunit_DATA = \
21	systemd/system/mctp-demux.service \
22	systemd/system/mctp-demux.socket
23endif
24
25bin_PROGRAMS = utils/mctp-demux-daemon
26noinst_PROGRAMS = utils/mctp-in utils/mctp-pipe
27utils_mctp_demux_daemon_SOURCES = utils/mctp-demux-daemon.c
28if HAVE_PCAP
29utils_mctp_demux_daemon_SOURCES += utils/mctp-capture.c
30endif
31utils_mctp_demux_daemon_LDADD = libmctp.la $(pcap_LIBS)
32utils_mctp_demux_daemon_CFLAGS = $(pcap_CFLAGS)
33
34pkgconfig_DATA = libmctp.pc
35
36if AUTOCONF_CODE_COVERAGE_2019_01_06
37include $(top_srcdir)/aminclude_static.am
38clean-local: code-coverage-clean
39distclean-local: code-coverage-dist-clean
40else
41@CODE_COVERAGE_RULES@
42endif
43
44AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
45AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
46AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
47
48TESTS = $(check_PROGRAMS)
49
50check_PROGRAMS = tests/test_eid tests/test_seq tests/test_bridge \
51		 tests/test_astlpc tests/test_serial tests/test_cmds \
52		 tests/test_core
53# We set a global LDADD here, as there's no way to specify it for all
54# tests. This means other targets' LDADDs need to be overridden.
55LDADD = tests/libtest-utils.a libmctp.la
56
57noinst_LIBRARIES = tests/libtest-utils.a
58
59tests_libtest_utils_a_SOURCES = tests/test-utils.c tests/test-utils.h
60
61@VALGRIND_CHECK_RULES@
62