build : provide extra properties yaml as config

Make it possible for the openpower-vpd-parser recipe to be able to
supply the extra properties YAML as configurable input.

Use extra-properties-example.yaml as input.

Change-Id: I0f975fb9d5da2368a915ba969ebffe96010d4fe8
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index de3232a..829bd27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,18 +10,36 @@
 	types.hpp \
 	utils.hpp
 
-# Be sure to build writefru.hpp before compiling
-BUILT_SOURCES = writefru.hpp
-CLEANFILES = writefru.hpp
-REQ_SCRIPT ?= ${abs_srcdir}/writefru.py
-REQ_SCRIPT_FILES ?= \
+# Be sure to build these before compiling
+BUILT_SOURCES = \
+	writefru.hpp \
+	extra-properties-gen.hpp
+CLEANFILES = \
+	writefru.hpp \
+	extra-properties-gen.hpp
+
+FRU_GEN_SCRIPT ?= \
+	${abs_srcdir}/writefru.py
+FRU_GEN_SCRIPT_FILES ?= \
 	${abs_srcdir}/writefru.yaml \
 	${abs_srcdir}/writefru.mako.hpp
+
+PROP_GEN_SCRIPT ?= \
+	${abs_srcdir}/extra-properties.py
+PROP_GEN_SCRIPT_FILES ?= \
+	${abs_srcdir}/extra-properties-example.yaml \
+	${abs_srcdir}/extra-properties.mako.hpp
+
 EXTRA_DIST = \
-	$(REQ_SCRIPT) \
-	$(REQ_SCRIPT_FILES)
-writefru.hpp: ${REQ_SCRIPT} ${REQ_SCRIPT_FILES}
+	$(FRU_GEN_SCRIPT) \
+	$(FRU_GEN_SCRIPT_FILES) \
+	$(PROP_GEN_SCRIPT) \
+	$(PROP_GEN_SCRIPT_FILES)
+
+writefru.hpp: ${FRU_GEN_SCRIPT} ${FRU_GEN_SCRIPT_FILES}
 	$(AM_V_GEN)@FRUGEN@
+extra-properties-gen.hpp: ${PROP_GEN_SCRIPT} ${PROP_GEN_SCRIPT_FILES}
+	$(AM_V_GEN)@PROPGEN@
 
 sbin_PROGRAMS = openpower-read-vpd
 openpower_read_vpd_SOURCES = \
diff --git a/configure.ac b/configure.ac
index 66d4cb6..246d88f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,9 @@
 AS_IF([test "x$FRU_YAML" == "x"], [FRU_YAML="writefru.yaml"])
 FRUGEN="$PYTHON $srcdir/writefru.py -i $FRU_YAML"
 AC_SUBST(FRUGEN)
+AS_IF([test "x$PROP_YAML" == "x"], [PROP_YAML="extra-properties-example.yaml"])
+PROPGEN="$PYTHON $srcdir/extra-properties.py -e $PROP_YAML"
+AC_SUBST(PROPGEN)
 
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile test/Makefile])