

.. index:: librarian, archive

*********
Librarian
*********

The ``nlib`` tool builds *libraries* (also called *archives*),
which are single files containing multiple object files and a symbol
index.

Creating a library
===================

To create a library, list all object files (``.o`` extension) and a
single output file (``.a`` extension).

.. code-block:: none

  $ nlib lib.a obj1.o obj2.o ashfx.o xtoal.o

The created library is typically used as input to the ``ln65816``
by specifying it on the command line. When linking with a library,
only used objects are included in the final output.


File format
===========

The file format is identical to ``ar`` on UNIX System V and GNU.
The archive includes an index for faster object selection.


Command line options
====================

Only ``--version`` and ``--help`` command-line options are supported.

To display the version of the linker, use ``--version``:

.. code-block:: console

    $ nlib --version
    Calypsi librarian for none version 5.16

