discover: Move platform config to a .ro
authorJeremy Kerr <jk@ozlabs.org>
Wed, 23 Jul 2014 05:32:08 +0000 (13:32 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 5 Aug 2014 02:43:07 +0000 (10:43 +0800)
We want to allow an external utility to use the platform config code, so
build it into a .ro, which is then linked to the discover code.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/Makefile.am

index 0dc5e898ab865b2734f36c30f3dfb5080e0e844c..cd5c95709d429617841dc3c73f269afb29cf78ac 100644 (file)
@@ -13,6 +13,7 @@
 #
 
 sbin_PROGRAMS += discover/pb-discover
+noinst_PROGRAMS += discover/platform.ro
 
 discover_pb_discover_SOURCES = \
        discover/boot.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 \
@@ -58,6 +56,7 @@ discover_pb_discover_SOURCES = \
 
 discover_pb_discover_LDADD = \
        discover/grub2/grub2-parser.ro \
+       discover/platform.ro \
        $(core_lib) \
        $(UDEV_LIBS)
 
@@ -69,5 +68,13 @@ discover_pb_discover_CPPFLAGS = \
        -DPKG_SHARE_DIR='"$(pkgsharedir)"' \
        -DPKG_SYSCONF_DIR='"$(pkgsysconfdir)"'
 
+discover_platform_ro_SOURCES = \
+       discover/platform.c \
+       discover/platform.h \
+       discover/platform-powerpc.c
+
+discover_platform_ro_LINK = \
+       $(LD) -r -o $@
+
 EXTRA_DIST += discover/native-parser.c