Alcatel-Lucent nmake Product Builder - Eclipse Plugin 0.4.0 Guide Alcatel-Lucent

nmake build definitions

The build definitions component of the nmake CDT plugin provides CDT build model element definitions that configure Eclipse CDT for nmake Makefile based builds. The definitions provide an nmake-specific project type called "nmake Makefile Project - gcc" containing 2 nmake-specific build configurations, called "nmake Makefile - Linux gcc/debug" and "nmake Makefile - Linux gcc/release" (or the equivalent for your platform). Each configuration provides a toolchain definition specialized for its purpose--debug or release build. Each toolchain provides a Builder element as well as individual tools including a preprocessor, compiler, assembler, and linker. The Builder definitions specify nmake arguments appropriate for debug and release builds, respectively. The tool definitions essentially serve as containers for information needed to adjust error parser, binary parser, and scanner discovery profile settings needed to correctly set up error parsers, paths and symbols. These settings allows the CDT indexer to properly parse input to set up the internal model of the code under development. The tool definitions all inherit from platform base tool definitions. This approach maximizes reuse of platform definitions and makes the system more robust to toolchain definition changes in new releases of CDT.

CDT 4.0.1 does not support option enablement for builders. This forces definition of separate toolchains for each configuration. However, the toolchain definitions were able to factor out common nmake Builder definition using inheritance and derive debug/release versions from those. This allows to factor out common nmake Builder setting definitions in one place, and allows the definitions to automatically acquire updated definitions in new platform releases.

When the plugin is installed, the nmake build definitions extend the CDT build model and appear in the CDT GUI as options in the project setup wizard and in the CDT properties view. Selection of these elements configures the CDT project with build model elements specialized for nmake.

The provided build elements and definitions leverage nmake baserules conventions including standardized variables and common actions. For examples, project level builds are performed using install and cleans are performed using recurse clobber.install clobber. Since nmake based projects inherit these rules "for free", these canned definitions should work for the majority of nmake based projects. However, the build definitions just provide initial default settings, project-specific customization is easily performed using the CDT GUI.

The definitions add recurse_begin_message=gnu to the nmake command line. This configures nmake to output recursion messages compatible with existing CDT make output parsers. We recommend setting recurse_begin_message=gnu in the project global Makefile. Setting it on the command line provides additional assurance that this parameter gets appropriately set.

Note that it was not possible to set the "Build Location" parameter in the build definitions. Since the build location defaults to the top level project directory, it is easiest to run project builds from that location. The example project includes a top level Makefile that simply recurses to the src directory for the actual build. Alternatively, the build location is configurable through the CDT GUI.