(Archive Members): Don't say archive file must exist. Instead, in ar cmds

example, use `c' flag and mention it is needed if archive doesn't exist.
(Archive Update): Fix typo: foo.o -> file.o.
This commit is contained in:
Roland McGrath 1994-04-21 00:55:18 +00:00
parent f2c10dedf0
commit f875c95115

View file

@ -7609,8 +7609,7 @@ main use is as subroutine libraries for linking.
@cindex archive member targets @cindex archive member targets
An individual member of an archive file can be used as a target or An individual member of an archive file can be used as a target or
dependency in @code{make}. The archive file must already exist, but the dependency in @code{make}. You specify the member named @var{member} in
member need not exist. You specify the member named @var{member} in
archive file @var{archive} as follows: archive file @var{archive} as follows:
@example @example
@ -7628,11 +7627,13 @@ use @code{ar}. For example, this rule says to create a member
@example @example
foolib(hack.o) : hack.o foolib(hack.o) : hack.o
ar r foolib hack.o ar cr foolib hack.o
@end example @end example
In fact, nearly all archive member targets are updated in just this way In fact, nearly all archive member targets are updated in just this way
and there is an implicit rule to do it for you. and there is an implicit rule to do it for you. @strong{Note:} The
@samp{c} flag to @code{ar} is required if the archive file does not
already exist.
To specify several members in the same archive, you can write all the To specify several members in the same archive, you can write all the
member names together between the parentheses. For example: member names together between the parentheses. For example:
@ -7700,8 +7701,8 @@ ar r foo.a dir/file.o
@end example @end example
@noindent @noindent
which has the effect of copying the file @file{dir/foo.o} into a member which has the effect of copying the file @file{dir/file.o} into a member
named @file{foo.o}. In connection with such usage, the automatic variables named @file{file.o}. In connection with such usage, the automatic variables
@code{%D} and @code{%F} may be useful. @code{%D} and @code{%F} may be useful.
@menu @menu