debug collector: use sdbus++ for exception files

Log sbusplus exceptions instead of phosphor-logging
error exceptions.

For metadata use manually generated elog-errors.hpp this
is to cater for building repositories without depending
on phosphor-logging

Resolves openbmc/openbmc#1469

Change-Id: I9789edd80f3477eeb66b93dff6e12a95e89a0005
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 4f6770d..90651d6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,31 @@
 AM_DEFAULT_SOURCE_EXT = .cpp
 sbin_PROGRAMS = checkstop_app
 
-checkstop_app_SOURCES = checkstop_app.cpp
-checkstop_app_LDFLAGS = $(PHOSPHOR_LOGGING_LIBS)
-checkstop_app_CXXFLAGS = $(PHOSPHOR_LOGGING_CFLAGS)
+nobase_nodist_include_HEADERS = \
+            org/open_power/Host/error.hpp
+
+BUILT_SOURCES = \
+            org/open_power/Host/error.cpp \
+            org/open_power/Host/error.hpp
+
+CLEANFILES = ${BUILT_SOURCES}
+
+checkstop_app_SOURCES = checkstop_app.cpp \
+                        org/open_power/Host/error.cpp
+
+checkstop_app_LDFLAGS = \
+                       $(PHOSPHOR_LOGGING_LIBS) \
+                       $(SDBUSPLUS_LIBS)
+
+checkstop_app_CXXFLAGS = \
+                     $(PHOSPHOR_LOGGING_CFLAGS) \
+                     $(SDBUSPLUS_CFLAGS)
+
+org/open_power/Host/error.hpp: ${top_srcdir}/org/open_power/Host.errors.yaml
+	@mkdir -p `dirname $@`
+	$(SDBUSPLUSPLUS) -r $(srcdir) error exception-header org.open_power.Host > $@
+
+org/open_power/Host/error.cpp: ${top_srcdir}/org/open_power/Host.errors.yaml
+	@mkdir -p `dirname $@`
+	$(SDBUSPLUSPLUS) -r $(srcdir) error exception-cpp org.open_power.Host > $@
+