Syntax

-ar

Description

This switch instructs the compiler driver to archive all output files into a library. Using -ar implies -c.

Example

The following command compiles file1.c, file2.asm, and file3.c to object code and archives them into the library file libfunc.a together with the object file file4.o.

cc -ar file1.c file2.asm file3.c file4.o -o libfunc.a