make: Archive Symbols
1
1 11.2.1 Updating Archive Symbol Directories
1 ------------------------------------------
1
1 An archive file that is used as a library usually contains a special
1 member named '__.SYMDEF' that contains a directory of the external
1 symbol names defined by all the other members. After you update any
1 other members, you need to update '__.SYMDEF' so that it will summarize
1 the other members properly. This is done by running the 'ranlib'
1 program:
1
1 ranlib ARCHIVEFILE
1
1 Normally you would put this command in the rule for the archive file,
1 and make all the members of the archive file prerequisites of that rule.
1 For example,
1
1 libfoo.a: libfoo.a(x.o) libfoo.a(y.o) ...
1 ranlib libfoo.a
1
1 The effect of this is to update archive members 'x.o', 'y.o', etc., and
1 then update the symbol directory member '__.SYMDEF' by running 'ranlib'.
1 The rules for updating the members are not shown here; most likely you
1 can omit them and use the implicit rule which copies files into the
1 archive, as described in the preceding section.
1
1 This is not necessary when using the GNU 'ar' program, which updates
1 the '__.SYMDEF' member automatically.
1