2015-10-22 08:31:52 +01:00
|
|
|
# ar
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Create, modify, and extract from archives (.a .so .o).
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Extract all members from an archive:
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2015-12-30 22:05:57 +00:00
|
|
|
`ar -x {{libfoo.a}}`
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- List the members of an archive:
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2015-12-30 22:05:57 +00:00
|
|
|
`ar -t {{libfoo.a}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Replace or add files to an archive:
|
2015-12-30 22:05:57 +00:00
|
|
|
|
|
|
|
`ar -r {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Insert an object file index (equivalent to using `ranlib`):
|
2015-12-30 22:05:57 +00:00
|
|
|
|
|
|
|
`ar -s {{libfoo.a}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Create an archive with files and an accompanying object file index:
|
2015-12-30 22:05:57 +00:00
|
|
|
|
|
|
|
`ar -rs {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
|