We have added a new Tool Repository to the web site to provide a collection of tools for use with Alcatel-Lucent nmake. The tools will be added and updated independently of nmake releases and can be downloaded and used as is or as a starting point for customization.
Currently tools are available for processing XML build logs.
The targets and
makefiles scripts provide examples
for processing XML logs in several different languages including Python,
XSLT, Groovy and Scala.
scripts list data about each triggered target in the build, including target
name, execution exit code, start time, and end time.
The makefiles scripts reports information
about the build in HTML format.
Note that all the Python scripts require Python 2.6 which is available in
durations.py reports the length of time each triggered shell action ran sorted longest to shortest. It can be used to identify slow areas of the build which may be candidates for optimization. Here is an example run.
$ durations.py makelog.xml 0:03:32.864556 targ2 src/cmd/t2 0:01:33.858293 targ3 src/cmd/t3 0:01:04.085014 targ4 src/cmd/t4 0:00:33.030622 targ1 src/cmd/t1 0:00:00.695936 ca.o src/cmd/t1 0:00:00.693648 cc.o src/cmd/t3 0:00:00.691520 cb.o src/cmd/t2 0:00:00.675594 b.o src/cmd/t3 0:00:00.660692 a.o src/cmd/t3 0:00:00.615385 a.o src/cmd/t2 0:00:00.612100 a.o src/cmd/t1 0:00:00.608247 b.o src/cmd/t2 0:00:00.121718 /home/richb/bin/targ4 src/cmd/t4 0:00:00.063113 ../../../bin/targ2 src/cmd/t2 0:00:00.061131 ../../../bin/targ3 src/cmd/t3 0:00:00.061090 ../../../bin/targ1 src/cmd/t1 0:00:00.044407 ../../../bin src/cmd/t2 0:00:00.042788 ../../../bin src/cmd/t1 0:00:00.041787 /home/richb/bin src/cmd/t4 0:00:00.041720 ../../../bin src/cmd/t3
errors.py generates a text based report of the errors in a build. The report contains a summary of the overall build along with details on each failed target and makefile, including exit code, target name, directory, shell command and output. The report can be emailed to project members or used as input to other scripts for automation. Here is an example run of a build with several errors:
$ errors.py makelog.xml Build exit code: 1 Number of failed targets: 3 Number of failed Makefiles: 2 Project name: Example Project Build name: Integration Build start time: 2010-12-17 15:06:51.240892 -05:00 Build end time: 2010-12-17 15:07:04.349690 -05:00 Build duration: 0:00:13.108798 Host: jaguar Directory: /home/richb/newsletter/n36/bld/src MAKEFILE: Makefile VPATH: /home/richb/newsletter/n36/bld MAKE: nmake Command line arguments: arg 1: -k arg 2: install Web log URL: http://my.example.com/mybuild Web Build Index URL: http://my.example.com Failed Target 1 =============== Error code: 1 Makefile target: a.o Execution directory: /home/richb/newsletter/n36/bld/src/cmd/t1 Offset from vpath: src/cmd/t1 Make recursion level (MAKELEVEL): 2 Start time: 2010-12-17 15:06:53.805588 -05:00 End time: 2010-12-17 15:06:54.325555 -05:00 Job duration: 0:00:00.519967 Why triggered: state variable (CCFLAGS) initialized to '-O' Weblog URL: http://my.example.com/mybuild/makefile_1_1_1.html#t1_1_1_2 Rule action output: + gcc -O -I- -c a.c a.c: In function `a': a.c:5: error: syntax error before '}' token Failed Target 2 =============== Error code: 1 Makefile target: a.o Execution directory: /home/richb/newsletter/n36/bld/src/cmd/t2 Offset from vpath: src/cmd/t2 Make recursion level (MAKELEVEL): 2 Start time: 2010-12-17 15:06:56.452323 -05:00 End time: 2010-12-17 15:06:56.973269 -05:00 Job duration: 0:00:00.520946 Why triggered: state variable (CCFLAGS) initialized to '-O' Weblog URL: http://my.example.com/mybuild/makefile_1_1_2.html#t1_1_2_2 Rule action output: + gcc -O -I- -c a.c a.c: In function `a': a.c:5: error: syntax error before '}' token Failed Target 3 =============== Error code: 1 Makefile target: b.o Execution directory: /home/richb/newsletter/n36/bld/src/cmd/t2 Offset from vpath: src/cmd/t2 Make recursion level (MAKELEVEL): 2 Start time: 2010-12-17 15:06:57.142291 -05:00 End time: 2010-12-17 15:06:57.743916 -05:00 Job duration: 0:00:00.601625 Why triggered: state variable (CCFLAGS) initialized to '-O' Weblog URL: http://my.example.com/mybuild/makefile_1_1_2.html#t1_1_2_3 Rule action output: + gcc -O -I- -c b.c b.c: In function `b': b.c:5: error: syntax error before '}' token Failed Makefile 1 ================= Error code: 1 Triggering parent rule: t3 Execution directory: /home/richb/newsletter/n36/bld/src/cmd/t3 Offset from vpath: src/cmd/t3 Make recursion level (MAKELEVEL): 2 Start time: 2010-12-17 15:06:58.771637 -05:00 End time: 2010-12-17 15:07:02.967979 -05:00 Makefile run duration: 0:00:04.196342 Weblog URL: http://my.example.com/mybuild/makefile_1_1_3.html Failed Makefile 2 ================= Error code: 1 Triggering parent rule: t4 End time: 2010-12-17 15:07:03.559060 -05:00 Weblog URL: http://my.example.com/mybuild/makefile_1_1_4.html
More tools will be added to the repository over time. Send us your suggestions to email@example.com.
The Oracle Studio 12.2 compilers have been certified with nmake 12 with
no issues. However we found that as of Studio 12.1 the C++ compiler no
longer searches the RogueWave (rw7) headers and libraries by default!
This means they are also not included in the default nmake search by the
CC.STDLIB probe variables.
The Studio 12.1 and 12.2 manuals indicate the RogueWave libraries are
obsolete and deprecated
(from http://download.oracle.com/docs/cd/E18659_01/html/821-1383/bkaje.html#scrolltoc [updated 07/07/2011 for new URL]):
librwtool (Tools.h++): Tools.h++ is a C++ foundation class library from RogueWave. Version 7 is provided. This library is obsolete and use of the library is deprecated in new code. It is provided to accommodate programs written for C++ 4.2 that used RW Tools.h++.
The RogueWave libraries can be accessed using the
-library=rwtools7_std option to the C++ compiler. It is best
to add this option to the nmake
CC variable so the additional
search directories will be picked up by probe. For example:
CC = /opt/SUNWspro/bin/CC -library=rwtools7_std
-p option you can also read the output from
an external process (command) and print to an external process. The
option will be properly documented in the next release. Usage of the
-p option is as follows.
- read -p command VAR
- Read stdout from command to variable VAR.
- print -p command string
- Send string as standard input to command. Note, stdout is lost but may be redirected to a file.
The following example shows both the
$ ls -l total 4 -rw-r--r-- 1 richb richb 145 Dec 17 16:17 Makefile -rw-r--r-- 1 richb richb 55 Dec 17 16:16 planets.list $ cat Makefile targ: .MAKE read -p "uname -sr" SYSTEM print system info: $(SYSTEM) read -i planets.list PLANETS print -p "sort -o planets.sort" $(PLANETS) $ cat planets.list Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune $ nmake system info: SunOS 5.6 $ cat planets.sort Earth Jupiter Mars Mercury Neptune Saturn Uranus Venus
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!