summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-01-25 10:50:23 -0600
committerRatan Gupta <ratagupt@in.ibm.com>2017-02-01 12:49:18 +0530
commit92cea96ccc7b6a7dc52ed0d64356fc67ab1422c1 (patch)
tree64a2cae97b9d00a4e4d8d23f48f4bfaf0e4dd8a0
parent0f2e7fe1bf008b96e5ea7da4dcf8d978c854eeb6 (diff)
downloadipmi-fru-parser-92cea96ccc7b6a7dc52ed0d64356fc67ab1422c1.tar.gz
ipmi-fru-parser-92cea96ccc7b6a7dc52ed0d64356fc67ab1422c1.zip
build: add rule to generate fru-gen.hpp
fru-gen.hpp needs as input a YAML file. Enable this to be provided via autotools configuration. Change-Id: I586c14651840b6a9697a93261f79c2a48f14071f Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
-rw-r--r--Makefile.am5
-rw-r--r--configure.ac7
2 files changed, 12 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 1fbd9c9..49c254d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,8 @@
+BUILT_SOURCES=fru-gen.hpp
AM_DEFAULT_SOURCE_EXT = .cpp
+CLEANFILES=$(BUILT_SOURCES)
+
sbin_PROGRAMS = phosphor-read-eeprom
phosphor_read_eeprom_SOURCES = readeeprom.cpp argument.cpp
@@ -19,3 +22,5 @@ libstrgfnhandler_la_SOURCES = strgfnhandler.cpp
libstrgfnhandler_la_LDFLAGS = -version-info 1:0:0 -shared
libstrgfnhandler_la_LIBADD = libwritefrudata.la
+fru-gen.hpp:
+ $(AM_V_GEN)@FRUGEN@ -o $(top_builddir) generate-hpp
diff --git a/configure.ac b/configure.ac
index ae03a47..18fd1d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,9 @@ AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
+AM_PATH_PYTHON([2.7],
+ [AC_SUBST([PYTHON], [echo "$PYTHON"])],
+ [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
# Checks for libraries.
AC_CHECK_LIB([mapper], [mapper_get_service])
@@ -51,6 +54,10 @@ AS_IF([test "x$enable_oe_sdk" == "xyes"],
AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
)
+AS_IF([test "x$YAML_GEN" == "x"], [YAML_GEN="example.yaml"])
+FRUGEN="$PYTHON $srcdir/scripts/fru_gen.py -i $YAML_GEN"
+AC_SUBST(FRUGEN)
+
# Create configured output
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
OpenPOWER on IntegriCloud