PEL: Use libpel.la for log daemon and peltool

As phosphor-log-manager and peltool share source files, create libpel.la
to contain those common files that will then be included by both of
them.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ie3882d1b0929bace10ae638a8762e2b804e594c7
diff --git a/extensions/openpower-pels/openpower-pels.mk b/extensions/openpower-pels/openpower-pels.mk
index dee798e..35b1b29 100644
--- a/extensions/openpower-pels/openpower-pels.mk
+++ b/extensions/openpower-pels/openpower-pels.mk
@@ -1,16 +1,24 @@
 phosphor_log_manager_SOURCES += \
+	extensions/openpower-pels/entry_points.cpp \
+	extensions/openpower-pels/manager.cpp \
+	extensions/openpower-pels/repository.cpp
+
+phosphor_log_manager_LDADD = \
+	libpel.la
+
+noinst_LTLIBRARIES = libpel.la
+
+libpel_la_SOURCES = \
 	extensions/openpower-pels/ascii_string.cpp \
 	extensions/openpower-pels/bcd_time.cpp \
 	extensions/openpower-pels/callout.cpp \
 	extensions/openpower-pels/callouts.cpp \
 	extensions/openpower-pels/data_interface.cpp \
-	extensions/openpower-pels/entry_points.cpp \
 	extensions/openpower-pels/failing_mtms.cpp \
 	extensions/openpower-pels/fru_identity.cpp \
 	extensions/openpower-pels/generic.cpp \
-        extensions/openpower-pels/hexdump.cpp \
+	extensions/openpower-pels/hexdump.cpp \
 	extensions/openpower-pels/log_id.cpp \
-	extensions/openpower-pels/manager.cpp \
 	extensions/openpower-pels/mru.cpp \
 	extensions/openpower-pels/mtms.cpp \
 	extensions/openpower-pels/paths.cpp \
@@ -20,57 +28,32 @@
 	extensions/openpower-pels/pel_values.cpp \
 	extensions/openpower-pels/private_header.cpp \
 	extensions/openpower-pels/registry.cpp \
-	extensions/openpower-pels/repository.cpp \
 	extensions/openpower-pels/src.cpp \
 	extensions/openpower-pels/section_factory.cpp \
 	extensions/openpower-pels/severity.cpp \
 	extensions/openpower-pels/user_data.cpp \
 	extensions/openpower-pels/user_header.cpp
 
+libpel_ldflags =  \
+	$(SYSTEMD_LIBS) \
+	$(PHOSPHOR_LOGGING_LIBS) \
+	$(SDBUSPLUS_LIBS) \
+	$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
+	$(SDEVENTPLUS_LIBS) \
+	-lstdc++fs
+
+libpel_la_LIBADD = $(libpel_ldflags)
+
+libpel_cxx_flags = \
+	$(SYSTEMD_CFLAGS) \
+	$(SDBUSPLUS_CFLAGS) \
+	$(SDEVENTPLUS_CFLAGS) \
+	$(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+
 registrydir = $(datadir)/phosphor-logging/pels/
 registry_DATA = extensions/openpower-pels/registry/message_registry.json
 
 bin_PROGRAMS += peltool
 
 peltool_SOURCES = extensions/openpower-pels/tools/peltool.cpp
-
-peltool_LDADD = \
-        extensions/openpower-pels/ascii_string.o \
-        extensions/openpower-pels/bcd_time.o \
-        extensions/openpower-pels/callout.o \
-        extensions/openpower-pels/callouts.o \
-        extensions/openpower-pels/failing_mtms.o \
-        extensions/openpower-pels/fru_identity.o \
-        extensions/openpower-pels/generic.o \
-        extensions/openpower-pels/hexdump.o \
-        extensions/openpower-pels/log_id.o \
-        extensions/openpower-pels/mru.o \
-        extensions/openpower-pels/mtms.o \
-        extensions/openpower-pels/paths.o \
-        extensions/openpower-pels/pce_identity.o \
-        extensions/openpower-pels/pel.o \
-        extensions/openpower-pels/pel_rules.o \
-        extensions/openpower-pels/pel_values.o \
-        extensions/openpower-pels/private_header.o \
-        extensions/openpower-pels/registry.o \
-        extensions/openpower-pels/repository.o \
-        extensions/openpower-pels/src.o \
-        extensions/openpower-pels/section_factory.o \
-        extensions/openpower-pels/severity.o \
-        extensions/openpower-pels/user_data.o \
-        extensions/openpower-pels/user_header.o
-
-
-peltool_LDFLAGS = \
-        $(SYSTEMD_LIBS) \
-        $(PHOSPHOR_LOGGING_LIBS) \
-        $(SDBUSPLUS_LIBS) \
-        $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
-        $(SDEVENTPLUS_LIBS) \
-        -lstdc++fs
-
-peltool_CXXFLAGS = \
-        $(SYSTEMD_CFLAGS) \
-        $(SDBUSPLUS_CFLAGS) \
-        $(SDEVENTPLUS_CFLAGS) \
-        $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+peltool_LDADD = libpel.la