configure: Add conditional platform builds
[petitboot] / discover / Makefile.am
index 1672035fdacc45ab7b74c0cf0425844fc53a971a..2b7c7940b051752b02d4d55d246872ea686c0dc8 100644 (file)
@@ -52,7 +52,8 @@ discover_pb_discover_SOURCES = \
        discover/user-event.h \
        discover/kboot-parser.c \
        discover/yaboot-parser.c \
-       discover/pxe-parser.c
+       discover/pxe-parser.c \
+       discover/syslinux-parser.c
 
 discover_pb_discover_LDADD = \
        discover/grub2/grub2-parser.ro \
@@ -62,7 +63,7 @@ discover_pb_discover_LDADD = \
 
 discover_pb_discover_LDFLAGS = \
        $(AM_LDFLAGS) \
-       -ldevmapper
+       $(DEVMAPPER_LIBS)
 
 discover_pb_discover_CPPFLAGS = \
        $(AM_CPPFLAGS) \
@@ -79,7 +80,27 @@ discover_platform_ro_SOURCES = \
        discover/ipmi.h \
        discover/dt.c \
        discover/dt.h \
-       discover/platform-powerpc.c
+       discover/hostboot.h
+
+if PLATFORM_POWERPC
+discover_platform_ro_SOURCES += discover/platform-powerpc.c
+endif
+
+# Build dummy last to put it at the end of the platforms section.
+discover_platform_ro_SOURCES += discover/platform-dummy.c
+
+if ENABLE_MTD
+discover_platform_ro_SOURCES += \
+       discover/hostboot.c
+
+discover_platform_ro_LDFLAGS = \
+       $(core_lib) \
+       $(UDEV_LIBS)
+
+endif
+
+discover_platform_ro_CPPFLAGS = \
+       $(AM_CPPFLAGS)
 
 discover_platform_ro_LINK = \
        $(LD) -r -o $@