build: conditionally build lpc and pci options

To avoid building all of the modules and compiling in code that's
ultimately unused depending on a configuration, set the building of
modules to be conditional upon the configuration options.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ic15acc770aa87fddb67081d3240dd3328eb0b9fb
diff --git a/Makefile.am b/Makefile.am
index bc5b5d7..9dbe34a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,12 +40,25 @@
 noinst_LTLIBRARIES = libfirmwareblob_common.la
 libfirmwareblob_common_la_SOURCES = \
 	firmware_handler.cpp \
-	lpc_handler.cpp \
-	pci_handler.cpp \
 	file_handler.cpp \
-	lpc_aspeed.cpp \
-	lpc_nuvoton.cpp \
 	internal/sys.cpp
+
+if ENABLE_LPC_BRIDGE
+libfirmwareblob_common_la_SOURCES += lpc_handler.cpp
+if ENABLE_ASPEED_LPC
+libfirmwareblob_common_la_SOURCES += lpc_aspeed.cpp
+endif
+if ENABLE_NUVOTON_LPC
+libfirmwareblob_common_la_SOURCES += lpc_nuvoton.cpp
+endif
+endif
+
+if ENABLE_PCI_BRIDGE
+if ENABLE_ASPEED_P2A
+libfirmwareblob_common_la_SOURCES += pci_handler.cpp
+endif
+endif
+
 libfirmwareblob_common_la_CXXFLAGS = \
 	$(SDBUSPLUS_CFLAGS) \
         $(PHOSPHOR_LOGGING_CFLAGS) \