make: Archive Members
1
1 11.1 Archive Members as Targets
1 ===============================
1
1 An individual member of an archive file can be used as a target or
1 prerequisite in 'make'. You specify the member named MEMBER in archive
1 file ARCHIVE as follows:
1
1 ARCHIVE(MEMBER)
1
1 This construct is available only in targets and prerequisites, not in
1 recipes! Most programs that you might use in recipes do not support
1 this syntax and cannot act directly on archive members. Only 'ar' and
1 other programs specifically designed to operate on archives can do so.
1 Therefore, valid recipes to update an archive member target probably
1 must use 'ar'. For example, this rule says to create a member 'hack.o'
1 in archive 'foolib' by copying the file 'hack.o':
1
1 foolib(hack.o) : hack.o
1 ar cr foolib hack.o
1
1 In fact, nearly all archive member targets are updated in just this
1 way and there is an implicit rule to do it for you. *Please note:* The
1 'c' flag to 'ar' is required if the archive file does not already exist.
1
1 To specify several members in the same archive, you can write all the
1 member names together between the parentheses. For example:
1
1 foolib(hack.o kludge.o)
1
1 is equivalent to:
1
1 foolib(hack.o) foolib(kludge.o)
1
1 You can also use shell-style wildcards in an archive member
1 reference. ⇒Using Wildcard Characters in File Names Wildcards.
1 For example, 'foolib(*.o)' expands to all existing members of the
1 'foolib' archive whose names end in '.o'; perhaps 'foolib(hack.o)
1 foolib(kludge.o)'.
1