Nokia nmake Product Builder
Customer Support Newsletter

http://www.bell-labs.com/project/nmake/newsletters/

Issue No. 42 - January 2013
Contacts
Articles
  1. nmake CDT Eclipse Plugin 1.0.0 Release
  2. Large File Update
  3. Using .REQUIRE.pattern
  4. Feedback and Suggestions

nmake CDT Eclipse Plugin 1.0.0 Release

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:

The following configurations have been certified:

Full documentation and installation are available from the nmake Eclipse plugin update site.

Figure 1. CDT project creation wizard - project type and toolchain selection.
[CDT project wizard]

Figure 2. Console build log for a project build.
[Console build log]


Large File Update

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.


Using .REQUIRE.pattern

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 prerequisite but libdef and 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 library, -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

Feedback and Suggestions

We are interested in any feedback you might have about nmake. Please send comments / suggestions to nmake@alcatel-lucent.com.

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 nmake@alcatel-lucent.com. Thanks for your support!

<<home / newsletters