Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

Release Notes -- Nokia nmake 10

July 2008
[Table of Contents] [Previous Section] [Next Section]

4. Changes Impacting alu3.9 Makefiles

The changes in nmake 10 are largely backward compatible with alu3.9. Every effort has been made to insure code changes do not unexpectedly change the documented behavior of nmake features.

The following may impact builds and require changes.

4.1 Using -KPIC/-Kpic with Sun Studio compilers

Description
The man pages for the recent Sun Studio compilers indicate the -KPIC and -Kpic flags are obsolete and the -xcode=pic32 and -xcode=pic13 flags should be used instead. The probe tool now detects the new flags before the old ones and will typically set probe variable CC.PIC=-xcode=pic32 for the pic flag when using these compilers. If -KPIC or -Kpic are hard-coded in CCFLAGS for building a shared library nmake will not be able to detect the pic flag and may not generate a shared library with the :LIBRARY: operator or may issue a warning with the :: operator.
Who is affected
Projects using compilers that support -xcode=pic32 and -xcode=pic13 pic flags such as Sun Studio.
What to do
Use the probe variable CC.PIC instead of hard-coding the pic flag. This also provides portability since CC.PIC will be set correctly for different compilers and platforms. For example:
CCFLAGS = $(CC.PIC)
When adding to CCFLAGS use the following to delay variable expansion:
CCFLAGS += $$(CC.PIC)

4.2 CTRL-M at the end of a line

Description
When reading a makefile CTRL-M characters at the end of a line are now ignored to support DOS style text files. Literal \r\n sequences in makefiles or job action blocks are changed to literal \n, possibly changing program behavior. These cases are believed to be rare. It is recommended to change such cases to use equivalent escape sequences. Here is a simple example:
$ cat Makefile
a= 'y^M
z'

t : .MAKE
	print $(a:C|\r|e|:C|\n|f|) 

$ od -cb Makefile
0000000   a   =       '   y  \r  \n   z   '  \n  \n   t       :       .
	 141 075 040 047 171 015 012 172 047 012 012 164 040 072 040 056
0000020   M   A   K   E  \n  \t   p   r   i   n   t       $   (   a   :
	 115 101 113 105 012 011 160 162 151 156 164 040 044 050 141 072
0000040   C   |   \   r   |   e   |   :   C   |   \   n   |   f   |   )
	 103 174 134 162 174 145 174 072 103 174 134 156 174 146 174 051
0000060      \n
	 040 012
0000062

# Old nmake:
$ nmake
'yefz'

# New nmake:
$ nmake
'yfz'
Who is affected
Projects using literal \r\n sequences in their makefiles.
What to do
Use escape sequences. Using the above example, CTRL-M can be represented using its hexadecimal value 0D as \x0D in nmake.
$ cat Makefile
a= 'y$("\x0D")
z'

t : .MAKE
	print $(a:C|\r|e|:C|\n|f|) 

$ nmake
'yefz'

$ cat Makefile
a= 'y$("\x0D")$("\x0A")z'

t : .MAKE
        print $(a:C|\r|e|:C|\n|f|) 

$ nmake
'yefz'

4.3 The MAKELEVEL variable

Description
The MAKELEVEL variable is now incremented in the parent make when setting up the environment for all shell action blocks. In alu3.9 MAKELEVEL was incremented at .MAKEINIT time in sub-makes. The new approach makes the new value of MAKELEVEL uniformly available throughout sub-make and action block execution. However, it leads to an incompatibility when accessing MAKELEVEL directly from shell action blocks. For example, in the shell action of a first level sub-make, $MAKELEVEL used to expand to 0, now it expands to 1.
Who is affected
Projects using the MAKELEVEL variable in shell action blocks.
What to do
For uniform behavior reference MAKELEVEL as an nmake variable (e.g. $(MAKELEVEL)) and not a shell variable (e.g. $MAKELEVEL).


[Table of Contents] [Previous Section] [Next Section]

Last Update: Friday,12-Aug-2016 12:23:54 EDT