blob: 0ef722138daba0d007d3e0ef0e1c0ad44c09adbb [file] [log] [blame]
Matt Spinler7a6ed302020-06-05 14:38:32 -05001if AUTOCONF_CODE_COVERAGE_2019_01_06
2include $(top_srcdir)/Makefile.am.include
3include $(top_srcdir)/aminclude_static.am
4clean-local: code-coverage-clean
5distclean-local: code-coverage-dist-clean
6else
7@CODE_COVERAGE_RULES@
8endif
9
10AM_LIBS = $(CODE_COVERAGE_LIBS)
11AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) -UNDEBUG $(GTEST_CPPFLAGS)
12AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
13AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
14AM_LDFLAGS = $(GMOCK_LIBS) -lgmock_main \
15 $(GTEST_LIBS) $(OESDK_TESTCASE_FLAGS) $(PTHREAD_LIBS) $(SDBUSPLUS_LIBS)
16
Marri Devender Raodd508462017-09-20 04:17:58 -050017if !INSTALL_SCRIPTS
Andrew Geissler328889d2016-10-10 12:43:48 -050018# export these headers
Saqib Khan2bb15192017-02-13 13:19:55 -060019nobase_include_HEADERS = \
20 phosphor-logging/log.hpp \
Patrick Venture59a6b1f2018-08-29 11:41:01 -070021 phosphor-logging/elog.hpp \
22 phosphor-logging/sdjournal.hpp \
23 phosphor-logging/test/sdjournal_mock.hpp
Andrew Geissler328889d2016-10-10 12:43:48 -050024
Adriana Kobylak37734302017-03-01 12:47:38 -060025nobase_nodist_include_HEADERS = \
Adriana Kobylakebd59fa2017-02-06 20:55:39 -060026 phosphor-logging/elog-errors.hpp \
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060027 xyz/openbmc_project/Logging/Internal/Manager/server.hpp
Andrew Geissler184690d2016-11-03 08:06:31 -050028
Adriana Kobylakc20dae82017-02-15 13:44:16 -060029libphosphor_logging_FILES = \
Patrick Venture59a6b1f2018-08-29 11:41:01 -070030 elog.cpp elog_meta.cpp sdjournal.cpp
Adriana Kobylakc20dae82017-02-15 13:44:16 -060031libphosphor_loggingdir = ${libdir}
32libphosphor_logging_LTLIBRARIES = libphosphor_logging.la
33libphosphor_logging_la_SOURCES = $(libphosphor_logging_FILES)
34libphosphor_logging_la_LDFLAGS = \
35 $(SYSTEMD_LIBS) \
36 $(SDBUSPLUS_LIBS) \
37 -version-info 1:0:0 -shared
38libphosphor_logging_la_CXXFLAGS = \
Patrick Williams81a91e32020-05-28 14:39:28 -050039 $(SDBUSPLUS_CFLAGS) \
40 $(SYSTEMD_CFLAGS)
Adriana Kobylakc20dae82017-02-15 13:44:16 -060041
Andrew Geissler328889d2016-10-10 12:43:48 -050042# Application test which runs in obmc env (qemu, real hardware)
Deepak Kodihalli739e9252017-03-05 23:23:50 -060043bin_PROGRAMS = logging-test callout-test
Andrew Geissler328889d2016-10-10 12:43:48 -050044logging_test_SOURCES = logging_test.cpp
Michael Tritze0eb1dd2017-02-19 20:57:46 -060045logging_test_LDADD = libphosphor_logging.la
Deepak Kodihalli739e9252017-03-05 23:23:50 -060046callout_test_SOURCES = callouts/callout_test.cpp
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050047
Patrick Venturee7310442019-03-28 13:52:13 -070048bin_PROGRAMS += phosphor-log-manager
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060049
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060050phosphor_log_manager_SOURCES = \
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060051 xyz/openbmc_project/Logging/Internal/Manager/server.cpp \
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060052 log_manager.cpp \
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060053 log_manager_main.cpp \
Adriana Kobylakd722b3a2017-02-28 12:10:44 -060054 elog-lookup.cpp \
Deepak Kodihallib388da62017-02-27 00:47:12 -060055 elog_entry.cpp \
Deepak Kodihalli682326a2017-03-06 05:26:53 -060056 elog-process-metadata.cpp \
Deepak Kodihalli72654f12017-06-12 04:33:29 -050057 elog_meta.cpp \
Patrick Venture59a6b1f2018-08-29 11:41:01 -070058 elog_serialize.cpp \
Matt Spinler99c2b402019-05-23 14:29:16 -050059 sdjournal.cpp \
Matt Spinlerf61f2922020-06-23 11:32:49 -050060 extensions.cpp \
61 util.cpp
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060062
Adriana Kobylak7298dc22017-01-24 12:21:50 -060063# Be sure to build needed files before compiling
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060064BUILT_SOURCES = \
Adriana Kobylakebd59fa2017-02-06 20:55:39 -060065 phosphor-logging/elog-errors.hpp \
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060066 elog-lookup.cpp \
Deepak Kodihalli88826f82017-02-28 02:47:07 -060067 elog-process-metadata.cpp \
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060068 xyz/openbmc_project/Logging/Internal/Manager/server.cpp \
Deepak Kodihallia3db0772017-03-02 09:15:51 -060069 xyz/openbmc_project/Logging/Internal/Manager/server.hpp \
70 callouts-gen.hpp
Andrew Geissler184690d2016-11-03 08:06:31 -050071
Adriana Kobylak7298dc22017-01-24 12:21:50 -060072CLEANFILES = \
Adriana Kobylakebd59fa2017-02-06 20:55:39 -060073 phosphor-logging/elog-errors.hpp \
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060074 elog-lookup.cpp \
Deepak Kodihalli88826f82017-02-28 02:47:07 -060075 elog-process-metadata.cpp \
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060076 xyz/openbmc_project/Logging/Internal/Manager/server.cpp \
Deepak Kodihallia3db0772017-03-02 09:15:51 -060077 xyz/openbmc_project/Logging/Internal/Manager/server.hpp \
78 callouts-gen.hpp
Andrew Geissler184690d2016-11-03 08:06:31 -050079
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050080# systemd required for journal interfaces
Adriana Kobylak7d0692a2016-12-06 15:13:23 -060081logging_test_LDFLAGS = $(SYSTEMD_LIBS) $(SDBUSPLUS_LIBS)
82logging_test_CXXFLAGS = $(SYSTEMD_CFLAGS) $(SDBUSPLUS_CFLAGS)
Deepak Kodihalli739e9252017-03-05 23:23:50 -060083callout_test_LDADD = libphosphor_logging.la
Patrick Williams81a91e32020-05-28 14:39:28 -050084callout_test_LDFLAGS = \
85 $(SDBUSPLUS_LIBS) \
86 $(SYSTEMD_LIBS) \
87 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
88callout_test_CXXFLAGS = \
89 $(SDBUSPLUS_CFLAGS) \
90 $(SYSTEMD_CFLAGS) \
91 $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
Adriana Kobylak8692ac92017-02-09 13:54:59 -060092phosphor_log_manager_LDFLAGS = \
93 $(SYSTEMD_LIBS) \
94 $(SDBUSPLUS_LIBS) \
Deepak Kodihalli72654f12017-06-12 04:33:29 -050095 $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
Matt Spinler8ebfd312019-06-03 12:43:59 -050096 $(SDEVENTPLUS_LIBS) \
Deepak Kodihalli72654f12017-06-12 04:33:29 -050097 -lstdc++fs
Adriana Kobylak8692ac92017-02-09 13:54:59 -060098phosphor_log_manager_CXXFLAGS = \
99 $(SYSTEMD_CFLAGS) \
100 $(SDBUSPLUS_CFLAGS) \
Matt Spinler8ebfd312019-06-03 12:43:59 -0500101 $(SDEVENTPLUS_CFLAGS) \
Adriana Kobylak8692ac92017-02-09 13:54:59 -0600102 $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
Adriana Kobylakf855c3e2016-09-29 20:48:08 -0500103
Matt Spinler99c2b402019-05-23 14:29:16 -0500104
105include extensions/extensions.mk
106
107
Adriana Kobylak1a7508b2017-02-13 22:51:40 -0600108xyz/openbmc_project/Logging/Internal/Manager/server.cpp: xyz/openbmc_project/Logging/Internal/Manager.interface.yaml xyz/openbmc_project/Logging/Internal/Manager/server.hpp
109 @mkdir -p `dirname $@`
110 $(SDBUSPLUSPLUS) -r $(srcdir) interface server-cpp xyz.openbmc_project.Logging.Internal.Manager > $@
111
112xyz/openbmc_project/Logging/Internal/Manager/server.hpp: xyz/openbmc_project/Logging/Internal/Manager.interface.yaml
113 @mkdir -p `dirname $@`
114 $(SDBUSPLUSPLUS) -r $(srcdir) interface server-header xyz.openbmc_project.Logging.Internal.Manager > $@
115
Andrew Geisslerf1f2cfa2016-11-21 15:16:45 -0600116ELOG_MAKO ?= elog-gen-template.mako.hpp
Adriana Kobylak7298dc22017-01-24 12:21:50 -0600117LOOKUP_MAKO ?= elog-lookup-template.mako.cpp
Deepak Kodihalli88826f82017-02-28 02:47:07 -0600118META_MAKO ?= elog-process-metadata.mako.cpp
Deepak Kodihallia3db0772017-03-02 09:15:51 -0600119CALLOUTS_MAKO ?= callouts-gen.mako.hpp
Adriana Kobylakf4690732017-02-19 09:53:34 -0600120ELOG_TEMPLATE_DIR ?= ${abs_srcdir}/tools/phosphor-logging/templates/
Andrew Geisslerf1f2cfa2016-11-21 15:16:45 -0600121REQ_FILES_TO_GEN ?= ${abs_srcdir}/tools/elog-gen.py\
Deepak Kodihalli88826f82017-02-28 02:47:07 -0600122 ${ELOG_TEMPLATE_DIR}/$(ELOG_MAKO)\
Matthew Barthc19ea652019-08-12 15:18:57 -0500123 ${ELOG_TEMPLATE_DIR}/$(LOOKUP_MAKO)\
Deepak Kodihallia3db0772017-03-02 09:15:51 -0600124 ${ELOG_TEMPLATE_DIR}/$(META_MAKO)\
125 ${abs_srcdir}/callouts/callouts.py\
126 ${abs_srcdir}/callouts/$(CALLOUTS_MAKO)
Andrew Geissler184690d2016-11-03 08:06:31 -0500127
128# Be sure to package up the required script, yaml, and mako template to
129# generate the header file
130EXTRA_DIST = $(REQ_FILES_TO_GEN)
131
Adriana Kobylakebd59fa2017-02-06 20:55:39 -0600132phosphor-logging/elog-errors.hpp: $(REQ_FILES_TO_GEN)
133 @mkdir -p `dirname $@`
134 $(AM_V_at)$(PYTHON) ${abs_srcdir}/tools/elog-gen.py -y ${YAML_DIR} -u ${YAML_DIR_TEST} -t ${ELOG_TEMPLATE_DIR} -m $(ELOG_MAKO) -o $@
Adriana Kobylak7298dc22017-01-24 12:21:50 -0600135elog-lookup.cpp: $(REQ_FILES_TO_GEN)
Adriana Kobylakebd59fa2017-02-06 20:55:39 -0600136 $(AM_V_at)$(PYTHON) ${abs_srcdir}/tools/elog-gen.py -y ${YAML_DIR} -u ${YAML_DIR_TEST} -t ${ELOG_TEMPLATE_DIR} -m $(LOOKUP_MAKO) -o $@
Deepak Kodihalli88826f82017-02-28 02:47:07 -0600137elog-process-metadata.cpp: $(REQ_FILES_TO_GEN)
138 $(AM_V_at)$(PYTHON) ${abs_srcdir}/tools/elog-gen.py -y ${YAML_DIR} -u ${YAML_DIR_TEST} -t ${ELOG_TEMPLATE_DIR} -m $(META_MAKO) -o $@
Deepak Kodihallia3db0772017-03-02 09:15:51 -0600139callouts-gen.hpp: $(REQ_FILES_TO_GEN)
140 $(AM_V_at)$(PYTHON) ${abs_srcdir}/callouts/callouts.py -i ${CALLOUTS_YAML}
Andrew Geissler184690d2016-11-03 08:06:31 -0500141
Brad Bishop9316b9a2017-02-10 14:21:37 -0500142pkgconfiglibdir = ${libdir}/pkgconfig
143pkgconfiglib_DATA = phosphor-logging.pc
144
Deepak Kodihallic4966192018-08-23 02:19:58 -0500145SUBDIRS = test phosphor-rsyslog-config
Marri Devender Raob0562c42017-10-12 23:55:08 -0500146endif
Marri Devender Raodd508462017-09-20 04:17:58 -0500147# Export elog-gen parser and mako script
148elogdir = ${datadir}/phosphor-logging/elog
149nobase_elog_DATA = \
150 tools/elog-gen.py \
151 tools/phosphor-logging/templates/elog-gen-template.mako.hpp
Matt Spinler7a6ed302020-06-05 14:38:32 -0500152
153# check_PROGRAMS =
154# XFAIL_TESTS =
155# TESTS = $(check_PROGRAMS)