ILIB Objects (OS/2, Windows)

ILIB objects are used to manipulate modules in a library. When you run ILIB, you can specify multiple objects in any order.

Each object consists of the ilib command, followed by the name of the object module that is the subject of the command. Separate objects on the command line with a space or tab character.

Summary of ILIB Objects

The following is a summary of ILIB objects.

Syntax Description Default
filename Add/replace the named object in the library. None
/E[XTRACT]:obj Copy the named object into the current directory and overwrite it if it already exists. None
/R[EMOVE]:obj Remove the named object from the list of objects to be placed in the output library None

Notes:

  1. ILIB objects are not case sensitive, so you can specify them in lower-, upper-, or mixed-case.

    You can also substitute a dash (-) for the slash (/) preceding the object. For example, -REMOVE:filename is equivalent to /REMOVE:filename.

  2. You can specify objects in either short or long form. For example, /R:filename and /RE:filename are equivalent to /REMOVE:filename. See the table above for the shortest acceptable form of each object.
  3. The order of operations when processing the command line is left to right.
  4. ILIB never makes changes to your input library while it runs. It copies the library and makes changes to the copy. If ILIB is interrupted, your original library will be restored.

    If you do not specify an output library, ILIB will not produce any output.

Add/Replace Object

Syntax Default
filename Add filename

The default action, when filename is specified on the command line without an associated object, is to add it to the library. If filename already exists in the library, it will be replaced.

Adding an Object Module to a Library

Type the name of the object file to be added on the command line. The .obj extension may be omitted.

ILIB uses the base name of the object file as the name of the object module in the library. For example, if the object file cursor.obj is added to a library file, the name of the corresponding object module is cursor.

Replacing an Object Module in a Library

Type the name of the object module to be replaced on the command line. The .obj extension may be omitted.

If the object module already exists in the library, ILIB will replace it with the new copy.

Combining Two Libraries

Specify the name of the library file to be added, including the .lib extension, on the command line. A copy of the contents of that library is added to the library file being modified. If both libraries contain a module with the same name, ILIB generates a warning message, and uses only the first module with that name.

ILIB adds the modules of the library to the library being changed. Note that the added library still exists as an independent library because ILIB copies the modules without deleting them.

Examples

ilib /out:mylib.lib mylib.lib sample.obj

The command above adds the file sample.obj to the library mylib.lib. If sample.obj already exists in the library mylib.lib, ILIB will replace it.

ilib /out:newlib.lib newlib.lib mylib.lib

The command above adds the contents of the library mylib.lib to the library newlib.lib. The library mylib.lib is unchanged after this command is executed.

/EXTRACT

Syntax Default
/E[XTRACT]:obj None

Use /EXTRACT to copy a module from the library into an object file of the same name. The module remains in the library.

When ILIB copies the module to an object file, it adds the .obj extension to the module name and places the file in the current directory. If a file with this name already exists, ILIB overwrites it.

Example

ilib mylib.lib /extract:sample

The command above copies the module sample from the mylib.lib library to a file called sample.obj in the current directory. The module sample in mylib.lib is not altered.

/REMOVE

Syntax Default
/R[EMOVE]:obj None

Use /REMOVE to delete an object module from a library. After /REMOVE, specify the name of the module to be deleted. Module names do not have path names or extensions.

Examples

ilib /out:mylib.lib mylib.lib /remove:sample

The command above deletes the module sample from the library mylib.lib.

ilib /out:mylib.lib mylib.lib /extract:sample /remove:sample

The command above copies sample.obj from the mylib.lib library to an object file in the current directory. Then sample.obj is deleted from the library.

Note:

ilib mylib.lib /remove:sample

does not change the library.



ILIB Options