summaryrefslogtreecommitdiffstats
path: root/doc/user/libraries.sgml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/libraries.sgml')
-rw-r--r--doc/user/libraries.sgml50
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/user/libraries.sgml b/doc/user/libraries.sgml
index ca2cb97..96814a7 100644
--- a/doc/user/libraries.sgml
+++ b/doc/user/libraries.sgml
@@ -92,6 +92,56 @@
</para>
<section>
+ <title>Building Libraries From Source Code or Object Files</title>
+
+ <para>
+
+ The previous example shows building a library from a
+ list of source files.
+ You can, however, also give the &b-link-Library; call
+ object files,
+ and it will correctly realize
+ In fact, you can arbitrarily mix source code files
+ and object files in the source list:
+
+ </para>
+
+ <para>
+
+ <programlisting>
+ Library('foo', ['f1.c', 'f2.o', 'f3.c', 'f4.o'])
+ </programlisting>
+
+ <para>
+
+ And SCons realizes that only the source code files
+ must be compiled into object files
+ before creating the final library:
+
+ </para>
+
+ <screen>
+ % <userinput>scons -Q</userinput>
+ cc -o f1.o -c f1.c
+ cc -o f3.o -c f3.c
+ ar rc libfoo.a f1.o f2.o f3.o f4.o
+ ranlib libfoo.a
+ </screen>
+
+ <para>
+
+ Of course, in this example, the object files
+ must already exist for the build to succeed.
+ See <xref linkend="chap-nodes">, below,
+ for information about how you can
+ build object files explicitly
+ and include the built files in a library.
+
+ </para>
+
+ </section>
+
+ <section>
<title>Building Static Libraries Explicitly: the &b-StaticLibrary; Builder</title>
<para>