configure: Add conditional platform builds
[petitboot] / discover / Makefile.am
index ef4c6027d1281b28db8aa26d3fda501d23c583d0..2b7c7940b051752b02d4d55d246872ea686c0dc8 100644 (file)
@@ -59,8 +59,7 @@ discover_pb_discover_LDADD = \
        discover/grub2/grub2-parser.ro \
        discover/platform.ro \
        $(core_lib) \
-       $(UDEV_LIBS) \
-       $(GPGME_LIBS)
+       $(UDEV_LIBS)
 
 discover_pb_discover_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -81,11 +80,14 @@ discover_platform_ro_SOURCES = \
        discover/ipmi.h \
        discover/dt.c \
        discover/dt.h \
-       discover/hostboot.h \
-       discover/platform-powerpc.c
+       discover/hostboot.h
 
-discover_platform_ro_CPPFLAGS = \
-       $(AM_CPPFLAGS)
+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 += \
@@ -97,5 +99,8 @@ discover_platform_ro_LDFLAGS = \
 
 endif
 
+discover_platform_ro_CPPFLAGS = \
+       $(AM_CPPFLAGS)
+
 discover_platform_ro_LINK = \
        $(LD) -r -o $@