The Object object is the root object.
Every class is a subclass of Object.

It provides the following fields:

$(o.object-length): the number of fields and methods in the object.

$(o.object-mem <var>): returns true iff the <var> is a field
or method of the object.

$(o.object-add <var>, <value>): adds the field to the object,
returning a new object.

$(o.object-find <var>): fetches the field or method from the object;
it is equivalent to $(o.<var>), but the variable can be non-constant.

$(o.object-map <fun>): maps a function over the object. The function
should take two arguments; the first is a field name, the second is the
value of that field. The result is a new object constructed from the
values returned by the function.

o.object-foreach: the object-foreach form is equivalent to object-map,
but with altered syntax.

o.object-foreach(<var1>, <var2>)
<body>

For example, the following function prints all the fields of an
object o.

PrintObject(o) =
o.object-foreach(v, x)
println($(v) = $(x))

The export form is valid in a object-foreach body. The following
function collects just the field names of an object.

A Map object is a dictionary from values to values. The <key>
values are restricted to simple values: integers, floating-point numbers,
strings, files, directories, and arrays of simple values.

The Map object provides the following methods.

$(o.length): the number of items in the map.

$(o.mem <key>): returns true iff the <key> is defined
in the map.

$(o.add <key>, <value>): adds the field to the map,
returning a new map.

$(o.find <key>): fetches the field from the map.

$(o.keys): fetches an array of all the keys in the map, in alphabetical order.

$(o.values): fetches an array of all the values in the map,
in the alphabetical order of the corresponding keys.

$(o.map <fun>): maps a function over the map. The function
should take two arguments; the first is a field name, the second is the
value of that field. The result is a new object constructed from the
values returned by the function.

o.foreach: the foreach form is equivalent to map,
but with altered syntax.

o.foreach(<var1>, <var2>)
<body>

For example, the following function prints all the fields of an
object o.

PrintObject(o) =
o.foreach(v, x)
println($(v) = $(x))

The export form is valid in a foreach body. The following
function collects just the field names of the map.

$(s.forall <fun>): tests whether each element of the sequence
satifies a predicate.

$(s.exists <fun>): tests whether the sequence contains an element
that satisfies a predicate.

$(s.sort <fun>): sorts a sequence. The <fun> is a comparison
function. It takes two elements (x, y) of the sequence, compares them, and returns
a negative number if x < y, a positive number if x > y, and zero if the two elements
are equal.

effects: the files that may be modified by a
side-effect when this target is built.

scanner_deps: static dependencies that must be built
before this target can be scanned.

static-deps: statically-defined build dependencies
of this target.

build-deps: all the build dependencies for the target,
including static and scanned dependencies.

build-values: all the value dependencies associated
with the build.

build-commands: the commands to build the target.

output-file: if output was diverted to a file,
with one of the --output-* options A,
this field names that file. Otherwise it is false.

The object supports the following methods.

find(file): returns a Target object for the given file.
Raises a RuntimeException if the specified target is
not part of the project.

find-optional(file): returns a Target object
for the given file, or false if the file is not
part of the project.

NOTE: the information for a target is constructed dynamically,
so it is possible that the Target object for a node will
contain different values in different contexts. The easiest way
to make sure that the Target information is complete is
to compute it within a rule body, where the rule depends on
the target file, or the dependencies of the target file.

The Shell object contains the collection of builtin functions
available as shell commands.

You can define aliases by extending this object with additional methods.
All methods in this class are called with one argument: a single array
containing an argument list.

echo

The echo function prints its arguments to the standard output channel.

jobs

The jobs method prints the status of currently running commands.

cd

The cd function changes the current directory.
Note that the current directory follows the usual scoping
rules. For example, the following program lists the
files in the foo directory, but the current
directory is not changed.

Links or copies src to dst, overwriting dst. Namely, ln-or-cp would first
delete the dst file (unless it is a directory), if it exists. Next it would try to create
a symbolic link dst poiting to src (it will make all the necessary adjustmnents of
relative paths). If symbolic link can not be created (e.g. the OS or the filesystem does
not support symbolic links), it will try to create a hard link. If that fails too, it will try
to forcibly copy src to dst.

history

Print the current command-line history.

digest

Print the digests of the given files.

grep

grep [-q] [-n] pattern files...

The grep function calls the omakegrep function.

Internal versions of standard system commands.

By default, omake uses internal versions of the following commands:
cp, mv, cat, rm, mkdir, chmod,
test, find.
If you really want to use the standard system versions of these
commands, set the USE_SYSTEM_COMMANDS as one of the first
definitions in your OMakeroot file.

mkdir

mkdir [-m <mode>] [-p] files

The mkdir function is used to create directories.
The -verb+-m+ option can be used to specify the permission
mode of the created directory. If the -p option
is specified, the full path is created.

The cp function copies a src file to
a dst file, overwriting it if it already exists.
If more than one source file is specified, the final file
must be a directory, and the source files are copied
into the directory.

-f

Copy files forcibly, do not prompt.

-i

Prompt before removing destination files.

-v

Explain what is happening.

rm

rm [-f] [-i] [-v] [-r] files
rmdir [-f] [-i] [-v] [-r] dirs

The rm function removes a set of files.
No warnings are issued if the files do not exist, or if
they cannot be removed.

Options:

-f

Forcibly remove files, do not prompt.

-i

Prompt before removal.

-v

Explain what is happening.

-r

Remove contents of directories recursively.

chmod

chmod [-r] [-v] [-f] mode files

The chmod function changes the permissions on a set of
files or directories. This function does nothing on Win32.
The mode may be specified as an octal number,
or in symbolic form [ugoa]*[-=][rwxXstugo]+.
See the man page for chmod for details.

Options:

-r

Change permissions of all files in a directory recursively.

-v

Explain what is happening.

-f

Continue on errors.

cat

cat files...

The cat function prints the contents of the files to stdout

test

testexpression[expression +]+[ --help[ --version
See the documentation for the test function.