Chapter 4. About application projects

Application project options

When creating an eCos application project within Eclipse, you have a fundamental choice to make:

  • Managed make projects are recommended for new users. All source code files within the project are implicitly considered to be part of the application and, in most cases, no further configuration is required. Compilation of these projects is fully managed by Eclipse.

    To use this sort of project for your application, create a project of type eCos Managed Make Application Project.

  • Standard make projects are for users who prefer to write a GNU makefile, or for situations where customised build steps are needed. The wizard offers to create a template makefile with eCos-specific build settings, which we strongly recommend; of course, you can customise as necessary.

    To use this sort of project for your application, create a project of type Makefile project. Then either the eCos Makefile Project subtype can be used to create a project with a template makefile to use as a starting point, or the Empty Project subtype can be used to create a completely empty project. In either case, ensure you select as your toolchain the eCos toolchain for standard make projects.

    The eCos project creation wizard will automatically set important default properties for the project. For example, if you select a project in the Project Explorer and view its properties by right-clicking and selecting Properties, then within the C/C++ Build properties you will see an entry for Environment variables. While the wizard provides sensible default values, you may in future wish to modify variables such as ECOS_INSTALL_DIR which by default will point into the eCos Configuration Project you selected at project creation time; or the PATH which is used to search for the eCos host tools and GNU toolchain executables.

    [Note]Note

    If changing ECOS_INSTALL_DIR to point to a different eCos configuration, then you will probably want to remove or update the reference to the associated eCos Configuration Project. This reference is there to inform Eclipse when a project may need rebuilding because it has a dependent project which has been updated. The procedure for updating this reference is the same as that for Managed Make application projects.

You must also understand what the end result of your project will be. In most cases this will be an executable. In some circumstances it is useful to create a library project for later use by application projects. To create a managed make library project, use the Static Library project type, ensuring you also select the eCos toolchain as the toolchain.

[Warning]Warning

A library project should be compiled with the same eCos configuration project which will be used to compile the application. If you use a different eCos configuration, the results will be difficult to predict.

To manage the building of a library yourself use a Makefile project in the same way as when creating a standard make application project. But in this case it will be up to you to construct a makefile which generates the necessary library. The name of the library must be assigned to the makefile variable TARGET, for example:

TARGET = libutils.a
      

No other project types are supported for use with eCos.

Managed-make application projects are created with what Eclipse calls two build configurations. The Debug configuration is the default; it has debugging symbols enabled and compiler optimisation turned off. Release turns on optimisation and omits debugging symbols; it is generally only used for performance testing and final deployment builds.