summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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