The nmake CDT Eclipse Plugin 1.0.0 has been released following its three month beta period. The plugin provides managed build definitions that configure Eclipse CDT for nmake builds for Makefile-based projects. The definitions leverage nmake common actions to pre-populate builder options with targets useful across a broad range of nmake-based projects. Out of the box, the plugin provides an nmake specific CDT Project Type and CDT build configurations for Debug and Release builds on several platforms. In common cases, the build definitions substantially reduce the need to manually specify build options for nmake based builds.
Other features provided by the plugin include:
- A set of Eclipse Error Parsers which recognize nmake messages in the build output, classify their severity, and enable Eclipse to use them for various purposes such as populating the problems view and creating problem markers.
- C and C++ sample projects packaged as Eclipse CDT project templates. For the sample projects provided, the need for manual option setup is eliminated.
The following configurations have been certified:
- nmake 14, Eclipse 4.2, CDT 8.1, Linux/Solaris
- nmake 14, Eclipse 3.7, CDT 8.0, Linux/Solaris
Full documentation and installation are available from the nmake Eclipse plugin update site.
In issue 26 we discussed how work around the "don't know how to make" error message when dealing with files over 2 GB in size. The native 64-bit Linux package introduced in nmake 14 can now deal with large files. When using the 64-bit package nothing special needs to be done. The nmake 14 release also introduced a proper warning message for files too large to reference (from the EFBIG or EOVERFLOW system errors).
$ cat Makefile targ : big.data : $(*) $ nmake make: warning: big.data ignored -- file too large make: don't know how to make targ : big.data
To avoid issues try the 64-bit Linux package or for other platforms refer to the article in issue 26.
The .REQUIRE.pattern special atom can be used to map a prerequisite to a list of prerequisites. One common use is to automatically pull in a list of libraries that are needed by another library. When set up in a global makefile the local makefiles only need to specify the main library and the targets will link with the full list of required libraries.
In the following example only
-labc is specified as a
libghi area also
included in the link step.
$ cat Makefile .REQUIRE.-labc% : .FUNCTION return -labc -ldef -lghi .SOURCE.a : lib hello :: hello.c -labc $ nmake + cc -O -I- -c hello.c + cc -O -o hello hello.o lib/libabc.a lib/libdef.a lib/libghi.a $ touch lib/libghi.a $ nmake + cc -O -o hello hello.o lib/libabc.a lib/libdef.a lib/libghi.a
As you can see .REQUIRE.pattern is
defined as a function. The main library is set in the
pattern portion of the special atom
which gives us "
.REQUIRE.-labc%". The "%" is required at the
end of the pattern even though the whole string is specified. The function
returns the list prerequisite libraries to include. Note that the main
-labc, must also be specified in the return list
otherwise it will be omitted from the link step. The additional libraries
are not only added to the link command but they are considered regular
prerequisites. As shown above, touching one of the extra libraries will
trigger an update as expected.
This technique can be used for other types of files too.
Another example uses .REQUIRE.pattern
to return a list of
.o files which are compiled for the target.
$ cat Makefile .REQUIRE.hello.c% : .FUNCTION return hello.o abc.o xyz.o hello :: hello.c $ nmake + cc -O -I- -c abc.c + cc -O -I- -c xyz.c + cc -O -I- -c hello.c + cc -O -o hello hello.o
The final example demonstrates a more general case.
$ cat Makefile .REQUIRE.file1% : .FUNCTION return file1 file2 file3 file4 targ : file1 : $(*) $ nmake + : file1 file2 file3 file4
We are interested in any feedback you might have about nmake. Please send comments / suggestions to firstname.lastname@example.org.
We're also open to suggestions for future articles. If there is anything you would like to see in the newsletter please send us a note to email@example.com. Thanks for your support!