Refactor to pass errors to watch through config YAML

Add errors to watch for through error YAML file
Add support for checkstop error type

Tested:
Generating dumps for elog, core, checkstop type errors.

Change-Id: Idd00ace2e3d0c472a74ec142e6d150e55e843a6f
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 30f0331..9279a1d 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,7 +55,8 @@
 # Be sure to build needed files before compiling
 BUILT_SOURCES = \
 	xyz/openbmc_project/Dump/Internal/Create/server.cpp \
-	xyz/openbmc_project/Dump/Internal/Create/server.hpp
+	xyz/openbmc_project/Dump/Internal/Create/server.hpp \
+	errors_map.hpp
 
 CLEANFILES=${BUILT_SOURCES}
 
@@ -71,3 +72,11 @@
 	@mkdir -p `dirname $@`
 	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-header \
 xyz.openbmc_project.Dump.Internal.Create > $@
+
+ERROR_TEMPLATE ?= ${abs_srcdir}/errors_map.mako.hpp
+ERROR_REQ_FILES_TO_GEN ?= ${abs_srcdir}/errors_map_gen.py \
+	${ERROR_TEMPLATE}
+
+EXTRA_DIST = $(ERROR_REQ_FILES_TO_GEN)
+errors_map.hpp: $(ERROR_REQ_FILES_TO_GEN)
+	$(AM_V_at)$(PYTHON) ${abs_srcdir}/errors_map_gen.py -i ${ERROR_MAP_YAML}