ChorusOS 5.0 Source Delivery Guide

ChorusOS Build Options

This section demonstrates the use of some optional build features.

Rebuilding a Component

You can delete any of the directories in build_dir during the generation process. If the directory is necessary, the make command will rebuild it. For example, you can remove the boot component and then run make, which will regenerate the component, if necessary.

host% rm -rf build-BSP/ 
host% make build

Rebuilding the conf directory

To return to a previous configuration, remove the conf directory, or some files from the conf directory. This returns the system to the default configuration or to the configuration you updated in the source configuration files. Even if you have not altered the configuration you can rebuild the conf files as follows:

host% rm -rf conf/
host% make xml

Binary Distribution Builds

Binary distributions are prebuilt components that speed the compilation process. To build a binary distribution of the EXAMPLES component, make the EXAMPLES.dist makefile target.


host% make EXAMPLES.dist

The EXAMPLES.dist makefile target creates an independent distribution of examples as a subdirectory, dist-EXAMPLES, of the build directory. This examples directory can be displaced and handled as a single entity, and used as directory of binaries with the -b option of the configure(1CC) build tool.

Updating the Source Configuration

The reconfigure makefile target adds components to an existing configuration. For example, you add the EXAMPLES component to an existing system in build_dir, as follows:

host% make  reconfigure NEWCONF='-s source_dir/opt/examples'
host% make

Build the Target NFS Root

The root makefile target lets you copy files from components into the build_dir/root directory.

For example, as the EXAMPLES component contains binary files that the target machine must see, use the make root command to copy the binary files of the EXAMPLES component into the build_dir/root directory as follows:

host% make root 

The build_dir/root directory now contains the binary files of the EXAMPLES component. You can run this component on a target machine where build_dir/root can be NFS mounted.

Using Binary Files Instead of Source Files

Taking the EXAMPLES component as an example, to use the EXAMPLES component's binary files, you must remove the current configuration of that component. There is no specific command to achieve this. Follow these four steps:

  1. Edit the reconfigure rule at the end of the top-level Makefile by removing the following line in the source file:

    -s source_dir/opt/examples

  2. Remove the component's build directory and run make reconfigure:

    host% rm -rf build-EXAMPLES/ 
    host% make reconfigure
    

  3. Add the application's binary files:

    host% make reconfigure NEWCONF='-b dist-EXAMPLES' 
    

  4. Run the make command

    host% make 
    

Verbose Mode Builds

To make all component builds in a build directory generate more messages, define a null macro, SILENT=, in the Paths file.


host% grep -i SILENT Paths
host% echo 'SILENT=' >> Paths
host% grep -i SILENT Paths
SILENT=
hosthost% make 

Once you have defined the null macro, SILENT=, builds generate status messages for every action taken.

Debug Mode Builds

To enable debugging for a component, you must build it with the FREMOTEDEB macro set to ON. When this macro is set in the paths file, it enables debugging information to be generated for all components.


host% grep -i FREMOTEDEB Paths
host% echo 'FREMOTEDEB=ON' >> Paths
host% grep -i FREMOTEDEB Paths
FREMOTEDEB=ON
host% make make-target
host% make

Components built with FREMOTEDEB=ON include debugging information and are therefore larger than components with FREMOTEDEB=OFF.

Forced Rebuilds

To force an unchanged component to be rebuilt, remove the DONE file created during the previous build. For example, to force re-compilation of all components previously built in the build directory:


host% cd build_dir
host% find build_dir -name DONE -exec rm -f {} \;
host% make