Building the System

Once a build tree has been generated with ecosconfig, building eCos is straightforward:

$ make

The build tree contains the subdirectories, makefiles, and everything else that is needed to generate the default configuration for the selected architecture and platform. The only requirement is that the tools needed for that architecture, for example powerpc-eabi-g++, are available using the standard search path. If this is not the case then the make will fail with an error message. If you have a multiprocessor system then it may be more efficient to use:

$ make -j n

where n is equal to the number of processors on your system.

Once the make process has completed, the install tree will contain the header files and the target library that are needed for application development.

It is also possible to build the system’s test cases for the current configuration:

$ make tests

The resulting test executables will end up in a tests subdirectory of the install tree.

If disk space is scarce then it is possible to make the copy of the install tree for application development purposes, and then use:

$ make clean

The build tree will now use up a minimum of disk space — the bulk of what is left consists of configuration header files that you may have edited and hence should not be deleted automatically. However, it is possible to rebuild the system at any time without re-invoking ecosconfig, just by running make again.

Under exceptional circumstances it may be necessary to run make clean for other reasons, such as when a new release of the toolchain is installed. The toolchain includes a number of header files which are closely tied to the compiler, for example limits.h, and these header files are not and should not be duplicated by eCos. The makefiles perform header file dependency analysis, so that when a header file is changed all affected sources will be rebuilt during the next make. This is very useful when the configuration header files are changed, but it also means that a build tree containing information about the locations of header files must be rebuilt. If a new version of the toolchain is installed and the old version is removed then this location information is no longer accurate, and make will complain that certain dependencies cannot be satisfied. Under such circumstances it is necessary to do a make clean first.