configure: Add conditional platform builds
[petitboot] / discover / Makefile.am
index 0dc5e898ab865b2734f36c30f3dfb5080e0e844c..2b7c7940b051752b02d4d55d246872ea686c0dc8 100644 (file)
@@ -13,6 +13,7 @@
 #
 
 sbin_PROGRAMS += discover/pb-discover
+noinst_PROGRAMS += discover/platform.ro
 
 discover_pb_discover_SOURCES = \
        discover/boot.c \
@@ -23,10 +24,10 @@ discover_pb_discover_SOURCES = \
        discover/device-handler.h \
        discover/discover-server.c \
        discover/discover-server.h \
+       discover/devmapper.c \
+       discover/devmapper.h \
        discover/event.c \
        discover/event.h \
-       discover/file.c \
-       discover/file.h \
        discover/params.c \
        discover/params.h \
        discover/parser.c \
@@ -39,9 +40,6 @@ discover_pb_discover_SOURCES = \
        discover/paths.h \
        discover/pb-discover.c \
        discover/pb-discover.h \
-       discover/platform.c \
-       discover/platform.h \
-       discover/platform-powerpc.c \
        discover/resource.c \
        discover/resource.h \
        discover/sysinfo.c \
@@ -54,13 +52,19 @@ 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 \
+       discover/platform.ro \
        $(core_lib) \
        $(UDEV_LIBS)
 
+discover_pb_discover_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       $(DEVMAPPER_LIBS)
+
 discover_pb_discover_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        -DLOCAL_STATE_DIR='"$(localstatedir)"' \
@@ -69,5 +73,34 @@ discover_pb_discover_CPPFLAGS = \
        -DPKG_SHARE_DIR='"$(pkgsharedir)"' \
        -DPKG_SYSCONF_DIR='"$(pkgsysconfdir)"'
 
-EXTRA_DIST += discover/native-parser.c
+discover_platform_ro_SOURCES = \
+       discover/platform.c \
+       discover/platform.h \
+       discover/ipmi.c \
+       discover/ipmi.h \
+       discover/dt.c \
+       discover/dt.h \
+       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 $@