These programs are shell scripts that invoke the appropriate standard tools
for the current operating system and architecture.
One can use them to write portable recipes for mkfiles.
9c compiles the named C
files into object files for the current system.
The system C compiler is invoked with warnings enabled.
-I option adds
path to the include path,
-D option defines
name in the C preprocessor.
defines the symbol
PLAN9PORT defined in the C preprocessor and adds
$PLAN9/include to the include path.
9c also defines
__sun__ on SunOS systems and
__Linux26__ on Linux systems with 2.6-series kernels.
9a assembles the named files into object files for the current system.
Unlike some system assemblers, it does
not promise to run the C preprocessor on the source files.
9l links the named object files and libraries to create the target executable.
-l option specifies that a library named
libname.a be found and linked.
-L option adds directories to the library search path.
9l invokes the system linker with
$PLAN9/lib already on the library search path.
9l searches the named objects and libraries for symbols of the form
__p9l_autolib_name, which it takes as indication that it should link
$PLAN9/lib/libname.a as well.
It also examines such libraries to find their own dependencies.
-l option at the beginning of the command line disables this behavior.
__p9l_autolib_name is added to an object file by the macro
AUTOLIB( name ), defined in
<u.h>. Header files associated with libraries contain
AUTOLIB annotations; ordinary programs need not use them.
Due to shortcomings in the implementation, a source file may not
contain the same
AUTOLIB statement multiple times.
9ar maintains object file archives called libraries.
The exact set of valid command keys varies from system to system,
9ar always provides the following key characters:
key is specified,
9ar inserts a table of contents, required by the linker, at
the front of the library.
The table of contents is
rebuilt whenever the archive is modified.
files from the archive file.
files in the archive file, or add them if missing.
List a table of contents of the archive.
If names are given, only those files are listed.
Extract the named files.
If no names are given, all files in the archive are
In neither case does
x alter the archive file.
Give a file-by-file
description of the making of a
new archive file from the old archive and the constituent files.
t, give a long listing of all information about the files,
somewhat like a listing by
mode uid/gid size date name
9ar will create a new archive when
afile does not exist, and give a warning.
c discards any old contents and suppresses the warning.