blob: dc0ddbf4573ae35948640e75f4dcb9c4edc19928 [file] [log] [blame]
Marri Devender Rao82056ee2017-04-27 00:54:50 -05001AM_DEFAULT_SOURCE_EXT = .cpp
Marri Devender Raoca045222017-09-26 11:58:59 -05002
Marri Devender Raoca045222017-09-26 11:58:59 -05003if !INSTALL_ERROR_YAML
Vishwanatha Subbanna0eff6092017-06-12 21:03:36 +05304sbin_PROGRAMS = checkstop_app \
5 watchdog_timeout
Marri Devender Rao82056ee2017-04-27 00:54:50 -05006
Marri Devender Raoce640f62017-05-14 09:11:05 -05007nobase_nodist_include_HEADERS = \
Marri Devender Rao0947c652017-10-24 02:27:15 -05008 org/open_power/Host/Boot/error.hpp
Marri Devender Raoce640f62017-05-14 09:11:05 -05009
Marri Devender Raocaeecac2017-09-26 12:06:24 -050010if GEN_ERRORS
11nobase_nodist_include_HEADERS += \
12 phosphor-logging/elog-errors.hpp
13endif
14
Marri Devender Raoce640f62017-05-14 09:11:05 -050015BUILT_SOURCES = \
Marri Devender Rao0947c652017-10-24 02:27:15 -050016 org/open_power/Host/Boot/error.cpp \
17 org/open_power/Host/Boot/error.hpp
Marri Devender Raoce640f62017-05-14 09:11:05 -050018
Marri Devender Raocaeecac2017-09-26 12:06:24 -050019if GEN_ERRORS
20BUILT_SOURCES += phosphor-logging/elog-errors.hpp
21endif
22
Marri Devender Raoce640f62017-05-14 09:11:05 -050023CLEANFILES = ${BUILT_SOURCES}
24
25checkstop_app_SOURCES = checkstop_app.cpp \
Marri Devender Rao0947c652017-10-24 02:27:15 -050026 org/open_power/Host/Boot/error.cpp
Marri Devender Raoce640f62017-05-14 09:11:05 -050027
Vishwanatha Subbanna0eff6092017-06-12 21:03:36 +053028watchdog_timeout_SOURCES = watchdog_timeout.cpp \
Marri Devender Rao0947c652017-10-24 02:27:15 -050029 org/open_power/Host/Boot/error.cpp
Marri Devender Raoce640f62017-05-14 09:11:05 -050030
Vishwanatha Subbanna0eff6092017-06-12 21:03:36 +053031generic_ldflags = \
32 $(PHOSPHOR_LOGGING_LIBS) \
33 $(SDBUSPLUS_LIBS)
34
35generic_cxxflags = \
36 $(PHOSPHOR_LOGGING_CFLAGS) \
37 $(SDBUSPLUS_CFLAGS)
38
39checkstop_app_LDFLAGS = ${generic_ldflags}
40watchdog_timeout_LDFLAGS = ${generic_ldflags}
41
42checkstop_app_CXXFLAGS = ${generic_cxxflags}
43watchdog_timeout_CXXFLAGS = ${generic_cxxflags}
Marri Devender Raoce640f62017-05-14 09:11:05 -050044
Marri Devender Rao0947c652017-10-24 02:27:15 -050045org/open_power/Host/Boot/error.hpp: ${top_srcdir}/org/open_power/Host/Boot.errors.yaml
Marri Devender Raoce640f62017-05-14 09:11:05 -050046 @mkdir -p `dirname $@`
Marri Devender Rao0947c652017-10-24 02:27:15 -050047 $(SDBUSPLUSPLUS) -r $(srcdir) error exception-header org.open_power.Host.Boot> $@
Marri Devender Raoce640f62017-05-14 09:11:05 -050048
Marri Devender Rao0947c652017-10-24 02:27:15 -050049org/open_power/Host/Boot/error.cpp: ${top_srcdir}/org/open_power/Host/Boot.errors.yaml
Marri Devender Raoce640f62017-05-14 09:11:05 -050050 @mkdir -p `dirname $@`
Marri Devender Rao0947c652017-10-24 02:27:15 -050051 $(SDBUSPLUSPLUS) -r $(srcdir) error exception-cpp org.open_power.Host.Boot> $@
Marri Devender Raocaeecac2017-09-26 12:06:24 -050052
53endif
Marri Devender Raoca045222017-09-26 11:58:59 -050054# Export error YAML to shared location
55yamldir = ${datadir}/phosphor-dbus-yaml/yaml
56nobase_yaml_DATA = \
Marri Devender Rao0947c652017-10-24 02:27:15 -050057 org/open_power/Host/Boot.errors.yaml
Marri Devender Raocaeecac2017-09-26 12:06:24 -050058
59# Generate phosphor-logging/elog-errors.hpp
60if GEN_ERRORS
61ELOG_MAKO ?= elog-gen-template.mako.hpp
62ELOG_DIR ?= ${OECORE_NATIVE_SYSROOT}${datadir}/phosphor-logging/elog
63ELOG_GEN_DIR ?= ${ELOG_DIR}/tools/
64ELOG_MAKO_DIR ?= ${ELOG_DIR}/tools/phosphor-logging/templates/
65YAML_DIR ?= ${OECORE_NATIVE_SYSROOT}${datadir}/phosphor-dbus-yaml/yaml
66phosphor-logging/elog-errors.hpp:
Marri Devender Rao0947c652017-10-24 02:27:15 -050067 @mkdir -p ${YAML_DIR}/org/open_power/Host
68 @cp ${top_srcdir}/org/open_power/Host/Boot.errors.yaml ${YAML_DIR}/org/open_power/Host/Boot.errors.yaml
Marri Devender Raocaeecac2017-09-26 12:06:24 -050069 @mkdir -p `dirname $@`
70 @chmod 777 $(ELOG_GEN_DIR)/elog-gen.py
71 $(AM_V_at)$(PYTHON) $(ELOG_GEN_DIR)/elog-gen.py -y ${YAML_DIR} -t ${ELOG_MAKO_DIR} -m ${ELOG_MAKO} -o $@
72endif