NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXTENDED DESCRIPTION | EXAMPLES | FILES | ATTRIBUTES | SEE ALSO | NOTES
ChorusOSMkMf is a host utility.
Use ChorusOSMkMf to create a Makefile from an Imakefile for a ChorusOS project.
The following options are supported:
This is the ChorusOS build directory created after the configure command is run. A configuration file called Paths will be searched for and used within this directory.
paths-file is the configuration file containing all the paths of the different ChorusOS components. This file is generally found in the ChorusOS build directory after a configure command; its name is Paths.
This is the directory where the code is built. By default this is the directory from which ChorusOSMkMf is called.
dist-dir is the directory where the binary delivery is stored. This directory is used if imake distribution rules specified in a Package.rules file are used.
source-dir is the directory containing the source code. By default, this is the directory from which ChorusOSMkMf is called. If the source directory contains a Project.tmpl file, the definitions it contains are applied recursively in the hierarchy.
compiler is the name of an alternate compiler to use instead of the usual compiler. It can be used to define a front-end to the usual compiler.
ChorusOSMkMf uses imake(1) to generate the Makefile from a project template, a set of cpp macros, and the application's Imakefile. In most cases, an Imakefile contains three things: a list of source files, a number of macros to specify the global compilation rules, and a number of macros specifying how to build the target. An Imakefile can generate several targets.
An Imakefile defines global compilation rules; the compilation rules use the VPATH make mechanism in order to allow multiple builds from the same set of source code.
The ChorusOSMkMf command will automatically use the Project.tmpl file located at the top-level of either the source directory or the build directory of the application. This Project.tmpl file is intended to contain the generic definitions for the whole application hierarchy. Typical information located in the Project.tmpl file includes compilation flags.
Flag |
Value |
Default value |
---|---|---|
WARN |
$(WARN_ON), $(WARN_OFF) |
$(WARN_ON) |
DEBUG | $(DEBUG_ON), $(DEBUG_OFF) | $(DEBUG_OFF) |
PROF | $(PROF_ON), $(PROF_OFF) | $(PROF_OFF) |
OPT | $(OPT_ON), $(OPT_OFF) | $(OPT_ON) |
The WARN, DEBUG, PROF, OPT flags are used to set or unset the warning, debug, profiling and optimization options of the compiler.
The INCLUDES and DEFINES flags are used to specify additional includes directives or variables definitions for the compiler.
An Imakefile also defines a macro with which to build dependencies, as follows:
Depend(srcs)
Packaging rules are also available to prepare a binary package for the application. They allow you to select a subset of files of either the original source files, or of the built files to be installed in the binary delivery application package. The various packaging rules are primitive: they copy the files without using any sophisticated installation rules.
The content of the generated Makefile depends on the original Imakefile. Each Makefile contains two targets for imake management:
Makefile: generates a Makefile in the current directory. Before rebuilding the Makefile, the current Makefile is renamed Makefile.bak.
Makefiles: generates Makefile files recursively, in subdirectories.
Standard cleaning rules are provided:
clean removes the .o objects files and temporary files.
veryclean removes the objects files, executables and libraries.
distclean removes the files from the binary delivery.
all constructs everything which must be built.
depend constructs the source file dependencies that are used by make to maintain the generated files. This target uses the makedepend(1) tool.
Most targets are called recursively in all sub-directories.
By default, ChorusOSMkMf runs in silent mode, and the make log includes an outline trace of the operations performed. To disable silent mode and get a full make trace, type:
make SILENT=''
or
gmake SILENT=''
Assuming the example directory contains the source code hierarchy of the application and the Imakefiles, and that you want to build an application for a ChorusOS version previously built in the ChorusOSdir-x86, use the following sequence of commands to compile the project:
To compile your example for the PowerPC platform from the same set of source code, you may use the following sequence of commands:
Following is a simple example of a Project.tmpl file which allows the build of the application in the source directory:
DEBUG=$(DEBUG_ON) DEFINES=-Dvar1 -Dvar2 INCLUDES=-I.
In order to build the application in a different directory and to be able to use the packaging rules, the Project.tmpl must contain the following:
#include "Package.rules" SRC_DIR = SourceDir BUILD_DIR = BuildDir DIST_DIR = DistDir VPATH = $(SRC_DIR)$(REL_DIR)
Imake compatibility rules with ChorusOS 3.2 are accessible through the directive:
#include "Imake32.rules"
All imake description files are located in the tool/imake directory of the ChorusOS installation directory:
ChorusOS build rules
ChorusOS 3.2 compatibility rules
Packaging rules
Definition of variables
ChorusOS specific information depending on the host/target configuration is located in the tool/tgt-make directory.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
ChorusOS 5.0 Application Developer's Guide
It is not possible to have a compilation in the source directory and another compilation of the same source code in another build directory. The user must choose either to have a unique build in the source directory or multiple builds in other directories.
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXTENDED DESCRIPTION | EXAMPLES | FILES | ATTRIBUTES | SEE ALSO | NOTES