Enable IBM PLDM OEM commands support
Create folder structure (oem/ibm) for ibm pldm oem commands. Move the
files from the ibm-pldm-oem repo [https://github.com/openbmc/ibm-pldm-oem]
to the folder oem/ibm/ under the pldm repo and enable conditional
compilation for it. The test files are also conditionally compiled.
You would need to provide --enable-oem-ibm to configure.
This is done to simplify the build time and runtime dependencies between the
standard and oem implementations.
Signed-off-by: Jinu Joy Thomas <jinu.joy.thomas@in.ibm.com>
Change-Id: Iaa93c73faff87290e3d3d5d155d9ecae6e7ee6f9
diff --git a/test/Makefile.am b/test/Makefile.am
index 71d0a02..ca75b47 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -9,6 +9,12 @@
libpldm_bios_test \
libpldmresponder_bios_test
+if OEM_IBM
+check_PROGRAMS += \
+ libpldmoem_fileio_test \
+ libpldmoemresponder_fileio_test
+endif
+
test_cppflags = \
-Igtest \
$(GTEST_CPPFLAGS) \
@@ -24,6 +30,13 @@
$(PTHREAD_LIBS) \
$(OESDK_TESTCASE_FLAGS)
+if OEM_IBM
+test_ldflags += \
+ $(SDBUSPLUS_LIBS) \
+ -lgmock \
+ -lstdc++fs
+endif
+
libpldm_base_test_CPPFLAGS = $(test_cppflags)
libpldm_base_test_CXXFLAGS = $(test_cxxflags)
libpldm_base_test_LDFLAGS = $(test_ldflags)
@@ -65,7 +78,6 @@
libpldmresponder_bios_test_SOURCES = \
libpldmresponder_bios_test.cpp
-
libpldmresponder_base_test_CPPFLAGS = $(test_cppflags)
libpldmresponder_base_test_CXXFLAGS = $(test_cxxflags)
libpldmresponder_base_test_LDFLAGS = $(test_ldflags)
@@ -73,5 +85,28 @@
$(top_builddir)/libpldm/libpldm_la-base.o \
$(top_builddir)/libpldmresponder/libpldmresponder_la-base.o \
$(CODE_COVERAGE_LIBS)
-
libpldmresponder_base_test_SOURCES = libpldmresponder_base_test.cpp
+
+if OEM_IBM
+libpldmoem_fileio_test_CPPFLAGS = $(test_cppflags) \
+ -I$(top_builddir)/oem/ibm/ \
+ -I$(top_builddir)/libpldm/
+libpldmoem_fileio_test_CXXFLAGS = $(test_cxxflags)
+libpldmoem_fileio_test_LDFLAGS = $(test_ldflags)
+libpldmoem_fileio_test_LDADD = \
+ $(top_builddir)/libpldm/libpldm_la-base.o \
+ $(top_builddir)/oem/ibm/libpldm/libpldm_la-file_io.o
+libpldmoem_fileio_test_SOURCES = $(top_builddir)/oem/ibm/test/libpldm_fileio_test.cpp
+
+libpldmoemresponder_fileio_test_CPPFLAGS = $(test_cppflags) \
+ -I$(top_builddir)/oem/ibm/ \
+ -I$(top_builddir)/libpldm/
+libpldmoemresponder_fileio_test_CXXFLAGS = $(test_cxxflags)
+libpldmoemresponder_fileio_test_LDFLAGS = $(test_ldflags)
+libpldmoemresponder_fileio_test_LDADD = \
+ $(top_builddir)/libpldm/libpldm_la-base.o \
+ $(top_builddir)/oem/ibm/libpldm/libpldm_la-file_io.o \
+ $(top_builddir)/oem/ibm/libpldmresponder/libpldmresponder_la-file_io.o
+libpldmoemresponder_fileio_test_SOURCES = $(top_builddir)/oem/ibm/test/libpldmresponder_fileio_test.cpp
+endif
+