Use lib to create, maintain, and customize object library files. lib enables putting objects into libraries, replacing objects with newer versions, deleting objects from libraries, and extracting objects from libraries. lib can generate a text listing of the contents of a library.
lib handles both 16-and 32-bit object files in Intel OMF format.
lib switches... libfile objfiles...
If a library file is modified or rewritten, an existing library file of the same name is renamed to a file with a .bak extension. (This action is disabled with the -n switch.) Any previous file of the same name with the .bak extension is deleted.
lib -h
Print help message.
lib foo a b c.obj
Create a library foo.lib and insert the object files a.obj b.obj and c.obj.
lib -l foo
Create listing file foo.lst of contents of foo.lib.
lib -d foo.lib a
Delete the object a.obj from foo.lib.
lib -x foo.lib b
Extract the object b.obj from foo.lib and write it to file b.obj.
lib foo.lib bar.lib a.obj
Add the contents of bar.lib and a.obj to foo.lib.
OBJS=a.obj b.obj c.obj foo.lib : $(OBJS) lib -c foo.lib $(OBJS)
If the list of OBJS gets too long for the command line, SMAKE can automatically create a response file. Use an SMAKE command like:
OBJS=a.obj b.obj c.obj foo.lib : $(OBJS) lib -c foo.lib \ @<< $(OBJS) <<
The usual technique is:
If the list of OBJS gets too long for the command line, MAKE will automatically create a response file that lib will use.
For compatibility with older makefiles and batch files, lib supports an older command line syntax. Such makefiles should be upgraded to the new command syntax.
Arguments are passed to lib via:
lib lib-file [switches][action-files],[list-file][;]
lib-file is the name of the library file to create or change. Its default file extension is .lib.
The switches are:
The action-files specify the objects on which to act and what to do with them. The action-files must be one or more object files in the current directory. The default extension for object files is .obj. When lib puts an object file into a library, it gives the object's module the name of the object file in uppercase and without an extension.
To specify what to do with each object file, put one of the following switches before the name(s) of the action-files:
The list-file produces a file listing the contents of the library. The file first lists all the public symbols in alphabetical order with the name of the modules to which they belong. Next, it lists the modules alphabetically with the public symbols in them. The default list-file extension is .lst. If there is a list-file but no action-files, lib produces a list file without modifying the library.
To concatenate two libraries, specify one as the lib-file and the other as an action-file. lib adds the modules from the action-file library to the other library without changing the names of the modules.
Note: lib doesn't allow two modules to contain the same public symbol.
If lib is run with no arguments, it prompts for the required arguments. Use the ampersand (&) character to continue input on a new line.
You can use lib with a response file, which contains the responses that the compiler would ask for if used interactively. For example, the response file below adds several objects to the library mywindow.lib and produces a listing file:
\dm\lib\mywindow.lib /c +winopen+winblank+winmove+winhide& +winshow+winputs+wingets+winprint \dm\mywin.lst;
If the response file is makewin.rsp, use lib like this:
lib @makewin.rsp
Don't use filenames beginning with @ because lib mistakes it for a response file.
OBJS=a.obj b.obj c.obj foo.lib : $(OBJS) -del foo.lib lib foo.lib/C/NOI +a+b+c;
If the list of OBJS gets too long for the command line, smake can automatically create a response file. Use an smake command like:
OBJS=a.obj b.obj c.obj foo.lib : $(OBJS) -del foo.lib lib foo.lib/C/NOI \ @<< +a& +b& +c; <<
If the list of OBJS gets too long for the command line, use multiple lib commands:
OBJS=a.obj b.obj c.obj foo.lib : $(OBJS) -del foo.lib lib foo.lib/C/NOI +a+b; lib foo.lib/NOI +c;
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル