The OMake builtin objects

Jason Hickey et. al.

April 11, 2006

Version 0.9.6.9

omake is a flexible build system designed for building a wide variety of projects. This document describes the built-in objects available to all programs. For an overview of omake, see the omake(1) man page.

Table of Contents

Pervasives

Pervasives defines the objects that are defined in all programs. The following objects are defined.

Object

Parent objects: none.

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

It provides the following fields:

Map

Parent objects: 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.

There is also simpler syntax when the key is a string. The table can be defined using definitions with the form $|key| (the number of pipe symbols | is allowed to vary).

    $|key 1| = value1
    $||key1|key2|| = value2    # The key is key1|key2
    X = $|key 1|               # Define X to be the value of field $|key 1|

The usual modifiers are also allowed. The expression $`|key| represents lazy evaluation of the key, and $,|key| is normal evaluation.

Number

Parent objects: Object.

The Number object is the parent object for integers and floating-point numbers.

Int

Parent objects: Number.

The Int object represents integer values.

Float

Parent objects: Number.

The Float object represents floating-point numbers.

Sequence

Parent objects: Object.

The Sequence object represents a generic object containing sequential elements. It provides the following methods.

Array

Parent objects: Sequence.

The Array is a random-access sequence. It provides the following additional methods.

String

Parent objects: Array.

Fun

Parent objects: Object.

The Fun object provides the following methods.

Rule

Parent objects: Object.

The Rule object represents a build rule. It does not currently have any methods.

Target

Parent object: Object.

The Target object contains information collected for a specific target file.

The object supports the following methods.

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.

Node

Parent objects: Object.

The Node object is the parent object for files and directories. It supports the following operations.

File

Parent objects: Node.

The file object represents the name of a file.

Dir

Parent objects: Node.

The Dir object represents the name of a directory.

Channel

Parent objects: Object.

A Channel is a generic IO channel. It provides the following methods.

InChannel

Parent objects: Channel.

A InChannel is an input channel. The variable stdin is the standard input channel.

It provides the following methods.

OutChannel

Parent object: Channel.

A OutChannel is an output channel. The variables stdout and stderr are the standard output and error channels.

It provides the following methods.

Location

Parent objects: Location.

The Location object represents a location in a file.

Position

Parent objects: Position.

The Position object represents a stack trace.

Exception

Parent objects: Object.

The Exception object is used as the base object for exceptions. It has no fields.

RuntimeException

Parent objects: Exception.

The RuntimeException object represents an exception from the runtime system. It has the following fields.

Shell

Parent objects: Object.

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.

References

See Also

omake(1), omake-quickstart(1), omake-options(1), omake-root(1), omake-language(1), omake-shell(1), omake-rules(1), omake-base(1), omake-system(1), omake-pervasives(1), osh(1), make(1)

Version

Version: 0.9.6.9 of April 11, 2006.

License and Copyright

©2003-2006, Mojave Group, Caltech

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Author

Jason Hickey et. al.
Caltech 256-80
Pasadena, CA 91125, USA
Email: omake-devel@metaprl.org
WWW: http://www.cs.caltech.edu/~jyh