Crossware

Table of Contents        Next topic       

LIBRARY MANAGER

Crossware Library Manager allows run time libraries to be created and maintained.  

If you have a Crossware C compiler package then this will already include some libraries.  You can use the library manager to modify these libraries.

If you have a Crossware relocatable assembler package, then you can use the library manager to create libraries for your own use.  The linker can then be instructed to search these libraries and will include modules from it only when it needs to in order to resolve otherwise unresolved symbols.

In order to include a module in a library you must compile or assemble your code to create a relocatable object module (a .OBJ file).  This object file can then be added to the library, or used to create a new library using the library commands described below.

You can also use the library manager to remove and extract modules from a library and combining libraries with each other.  The library manager can also be used to list the contents of a library.

The library manager is run from the command line with the command

LIB [[command] [command]...][ifile] [ofile] [/options]
    

where    [ifile] is the input library file
    [ofile] is the output library file
    [command] specifies the action to be taken and the file to add, subtract or extract from the library
    [/options] is a space seperated list of options

The commands and options can be placed in any position on the command line except that the input library filename must precede the output library filename.  If you do not specify any arguments following the LIB command you will be prompted for the commands, the input library file name and the output library filename.  You will not be prompted for any options, these can only be specified by including them on the command line.

If you only specify an input library and nothing else, the library manager will list the contents of the library.  If the same file is specified for the input library and output library, then the original library file is not overwritten but is instead renamed with a .BAK extension.

If you include the input library filename on the command line and terminate it with a semicolon you will  suppress the prompt for the output filename.  The library manager will then use the same file for both input and output libraries.

You must always specify an input library filename even if one does not exist.

The library commands are as follows:

+ <filename>    This command adds the object code in the file specified by <filename> to the input library file to create the output library file.  If <filename> is a library file, then all of the modules in this library are added.

- <modulename>     This command removes the object code module specified by <modulename> from the input library to create the output library file.

- + <filename>    This command replaces the module already in the input library with the new version contained in the file specified by <filename> to create the output library file.

* <modulename>     This command extracts the module specified by <modulename> from the input library file to create a .OBJ file containing that module.

-* <modulename>    This command extracts the module specified by <modulename> from the input library file to create a .OBJ file containing that module and also removes it from the input library to create the output library.

If you do not use a file extension when you specify <filename>, the library manager will automatically add a .OBJ extension.

If the file specified by <filename> does not contain an instruction specifying a module name, the root of the file name is used as the module name.

If you added a '+' to the last library command on a line, the library manager will prompt for additional commands.

You can include all of your commands and library filenames in a file and instruct the library manager to read that file (the response file) instead of reading this keyboard.  To do this, place @<filename> on the end of the command line.  For instance

LIB @LIB.RSP

will take its input from the file LIB.RSP.

The contents of the response file should be constructed to mimic what would otherwise be entered at the keyboard in response to the library prompts.

Only one option is available.  This is /SNOERR (no error when subtracting).  This prevents the library manager from terminating if you instruct it to remove a module that is not present in the input library.