Move header generation tool and templates to sub-directories
This is being done to prep for exporting the tools and
templates to be used by other repos
Change-Id: Ia93166ade2a0361eca86cde123875b95a44a1ef3
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index ba54f20..4a34477 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,14 +17,14 @@
logging_test_LDFLAGS = $(SYSTEMD_LIBS)
ELOG_YAML ?= ${abs_srcdir}/elog.yaml
-ELOG_MAKO ?= ${abs_srcdir}/elog-gen-template.mako.hpp
-REQ_FILES_TO_GEN ?= ${abs_srcdir}/elog-gen.py $(ELOG_YAML) $(ELOG_MAKO)
+ELOG_MAKO ?= ${abs_srcdir}/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
+REQ_FILES_TO_GEN ?= ${abs_srcdir}/tools/elog-gen.py $(ELOG_YAML) $(ELOG_MAKO)
# Be sure to package up the required script, yaml, and mako template to
# generate the header file
EXTRA_DIST = $(REQ_FILES_TO_GEN)
elog-gen.hpp: $(REQ_FILES_TO_GEN)
- $(AM_V_at)${abs_srcdir}/elog-gen.py -e $(ELOG_YAML) -m $(ELOG_MAKO) -o ${abs_srcdir}/elog-gen.hpp
+ $(AM_V_at)${abs_srcdir}/tools/elog-gen.py -e $(ELOG_YAML) -m $(ELOG_MAKO) -o ${abs_srcdir}/elog-gen.hpp
SUBDIRS = test
\ No newline at end of file
diff --git a/elog-gen.py b/tools/elog-gen.py
similarity index 100%
rename from elog-gen.py
rename to tools/elog-gen.py
diff --git a/elog-gen-template.mako.hpp b/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
similarity index 100%
rename from elog-gen-template.mako.hpp
rename to tools/phosphor-logging/templates/elog-gen-template.mako.hpp
diff --git a/tools/phosphor-logging/templates/elog-lookup-template.mako.cpp b/tools/phosphor-logging/templates/elog-lookup-template.mako.cpp
new file mode 100644
index 0000000..a96760e
--- /dev/null
+++ b/tools/phosphor-logging/templates/elog-lookup-template.mako.cpp
@@ -0,0 +1,25 @@
+## Note that this file is not auto generated, it is what generates the
+## elog-lookup.hpp file
+// This file was autogenerated. Do not edit!
+// See elog-gen.py for more details
+#pragma once
+
+#include <map>
+#include <vector>
+
+namespace phosphor
+{
+
+namespace logging
+{
+
+std::map<std::string,std::vector<std::string>> g_errMetaMap = {
+ % for a in errors:
+ <% meta_string = '\",\"'.join(meta[a]) %> \
+ {"${errors[a]}",{"${meta_string}"}},
+ % endfor
+};
+
+} // namespace logging
+
+} // namespace phosphor