The ChorusOS imake environment enhances the make environment by
providing template rules for common ChorusOS build operations using generic
names. When using the predefined imake rules, it is not
necessary to know which libraries, crt
files, or
entry points should be used to build an application, because they are selected
automatically.
Instead of creating Makefiles you create Imakefiles, and imake generates Makefiles from them.
The imake environment is defined by four files containing sets of variables and rules. These files are located in the tools/imake directory. The rules are independent of the compiler you use.
Imake.tmpl contains definitions of variables. See "imake Variable Definitions".
Imake.rules contains build rules. See "imake Build Rules".
Package.rules contains rules used to build a binary distribution. See "imake Packaging Rules".
The Imake.tmpl file contains the following definitions:
FAMILY, indicates the target family (x86, usparc, ppc60x, mpc860).
COMPILER, identifies the compiler to be used (for example, gcc).
REL_DIR, specifies the path of the current directory. This variable is automatically set in subdirectories by imake.
HOST, indicates the host operating system (SOLARIS).
DEVTOOLS_DIR, indicates the path of the ChorusOS development tools.
The Imake.rules file contains macros known as Imake build rules. A list of Imake build rules and their functions is displayed in Table 6-4.
Table 6-4 imake Build RulesMacro name | Function |
---|---|
MakeDir(dir) | Creates a directory named dir. |
LibraryTarget(lib, objs) | Adds the objects indicated by objs into the library lib. |
Depend(srcs) | Computes the dependencies of srcs and adds them to the dependency list in the Makefile (using makedepend). |
ActorTarget(prog, objs, options, crt0, libs) | Uses objs to create a C actor called prog, and passes options, crt0 and libs to the linker. |
UserActorTarget(prog, objs, libs) | Creates a user C actor or process. |
SupActorTarget(prog, objs, libs) | Creates a supervisor C actor or process. |
EmbeddedUserActorTarget(prog, objs, libs) | Creates an embedded user C actor. |
EmbeddedSupActorTarget(prog, objs, libs) | Creates an embedded supervisor C actor. |
BuiltinDriver(prog, objs, libs) | Creates a ChorusOS operating system driver. |
BspProgTarget(prog, entry, objs, libs) | Creates a BSP program. |
CXXActorTarget(prog, objs, options, crt0, libs) | Uses objs to create a C++ actor or process named prog, and passes options, crt0 and libs to the linker. |
CXXUserActorTarget(prog, objs, libs) | Creates a user C++ actor or process. |
CXXSupActorTarget(prog, objs, libs) | Creates a supervisor C++ actor or process. |
CXXEmbeddedUserActorTarget(prog, objs, libs) | Creates an embedded user C++ actor. |
CXXEmbeddedSupActorTarget(prog, objs, libs) | Creates an embedded supervisor C++ actor. |
DynamicUserTarget(prog, objs, libs, dynamicLibs, dlDeps, options) | Creates a dynamic user C process. |
DynamicSupTarget(prog, objs, libs, dynamicLibs, dlDeps, options) | Creates a dynamic supervisor C process. |
DynamicCXXUserTarget(prog, objs, libs, dynamicLibs, dlDeps, options) | Creates a dynamic user C++ process. |
DynamicCXXSupTarget(prog, objs, libs, dynamicLibs, dlDeps, options) | Creates a dynamic supervisor C++ process. |
DynamicLibraryTarget(dlib, objs, staticLibs, dynamicLibs, dlDeps, options) | Creates a dynamic library. |
SharedUserTarget(prog, shobjs, staticLibs, sharedLibs, slDeps, options) | Creates a shared user C process. |
SharedSupTarget(prog, objs, staticLibs, sharedLibs, slDeps, options) | Creates a shared supervisor C process. |
SharedCXXUserTarget(prog, objs, staticLibs, sharedLibs, slDeps, options) | Creates a shared user C++ process. |
SharedCXXSupTarget(prog, objs, staticLibs, sharedLibs, slDeps, options) | Creates a shared supervisor C++ process. |
SharedLibraryTarget(shlib, shobjs, sharedLibs, staticLibs, slDeps, options) | Creates a shared library. |
The rules for building actors and processes use the following common arguments:
obj is the list of binary objects included in the actor/process.
prog is the name of the actor/process.
libs is the list of additional libraries used to build the actor/process. The application is linked by default with the library to provide either the basic or extended environment.
The rules used to build dynamic or shared libraries for actors and processes are described in more detail in "Building a Dynamic Process".
The Package.rules file contains macros known as Imake packaging rules which are used for building a binary distribution. Their names and functions are listed in Table 6-5.
Table 6-5 imake Packaging RulesMacro name | Function |
---|---|
DistLibrary(lib, dir) | Creates the directory dir and copies the library lib into it. |
DistActor(actor, dir) | Creates the directory dir and copies the actor actor into it. |
DistFile(file, dir) | Creates the directory dir and copies the file file into it. |
DistRenFile(file, nFile, dir) | Creates the directory dir, copies file into it, changing the name of file to nFile. |
DistProgram(program, dir) | Creates the directory dir and copies program into it. |