eCos application development requires the use of GNU toolchain components including the GCC compiler, LD linker and GDB debugger. CDT assumes that the locations of all compilation and debugging tools are either specified absolutely within makefiles and dialog boxes or that their locations are listed in the PATH environment variable. The eCosCentric installer will ensure that the GNU toolchain supplied with the eCosPro Developer's Kit is on the PATH when you invoke Eclipse via the appropriate eCosPro start menu item.
CDT supports the creation of both Managed Make and Standard Make C/C++ projects for eCos application development. The use of Managed Make projects is recommended for new users. Standard Make projects provide greater flexibility for those familiar with the creation of GNU makefiles.
To create a new Eclipse Managed Make project for eCos application development, invoke the New Project wizard using the File->New->Project... menu item. Select C Project or C++ Project from the tree of project types within the New Project wizard depending on whether the project will contain any C++ code. On the next page of the wizard, enter the project name and select the Executable or Static Library project type. Due to limitations within the GNU toolchain, the project name and project location should not contain any spaces. Finally, select the eCos GNU toolchain for the relevant processor architecture and click Finish.
The eCos install tree containing the eCos library and header files is specified by modifying the value of the eCosInstallDir build variable within the project's Properties dialog box. Select the project name in the C/C++ Projects view and then invoke the Properties dialog using the File->Properties menu item. Select C/C++ Build->Variables, check the Show system variables box, select the eCosInstallDir variable and then click on the Edit button. Specify the path to an existing eCos install tree as the value of the build variable and click OK. You will need to repeat the above procedure for each configuration of your project. Select a configuration using the Configuration drop-down list box near the top of the dialog box and modify the eCosInstallDir build variable appropriately.
To create a new Eclipse Standard Make project for eCos application development, invoke the New Project wizard using the File->New->Project... menu item. Select C Project or C++ Project from the tree of project types within the New Project wizard depending on whether the project will contain any C++ code. On the next page of the wizard, enter the project name and select the Makefile project->eCos Application Project project type. Due to limitations within the GNU toolchain, the project name and project location should not contain any spaces. Finally, select the eCos GNU toolchain for the relevant processor architecture and click Finish.
The resulting project will include a Makefile file containing two makefile variables which the user should edit to adapt the makefile to a specific project:
TARGET - the application executable file name (with no suffix) or static library filename (with .a suffix).
SOURCES - a space-separated list of C, C++ and assembly source files (*.c *.cc *.cpp *.cxx *.S) to be built.
The makefile includes rules to generate and use header file dependency information automatically. This dependency information is stored in files with a .d suffix.
The eCos install tree containing the eCos library and header files is specified by defining a build variable within the project's Properties dialog box. Select the project name in the C/C++ Projects view and then invoke the Properties dialog using the File->Properties menu item. Select C/C++ Build->Variables and then click on the Add button. Enter the variable name eCosInstallDir and set the type to directory within the Define a new build variable dialog box. Specify the path to an existing eCos install tree as the value of the build variable and click OK.