Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

Release Notes -- Nokia nmake 3.1

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

2. New Features Introduced in Release 3.1

The following new features are included in this release.

2.1 Variables

2.1.1 New Semantic of Automatic Variable $(#)

This new automatic variable is expanded to the number of actual arguments in the following constructs:

    local -[n] arg ... 
    local (formal ...) actual 

For example:

    F1 : .FUNCTION 
	    local (a b c) $(%)
	    print $(#)
    
    F2 : .FUNCTION 
	    local - a b 
	    print $(#)
    t :
	    $(F1 1 2 3)
	    $(F2 1 2)

This example will return the number of actual arguments, 3 and 2. This can be used to get local function arguments (a b c) and set their values from the actual arguments into $(%).

2.1.2 New Automatic Variable $(;)

This new automatic variable replaces of the previous semantics of $(#). It is expanded to the state variable value of the current target while the current target is a state variable. For example:

    XX = bin

    (XX) : a.c
	    : XX is $(;)

returns bin.

2.2 Assertion Operators

2.2.1 Extended Functionality of :MAKE:

The rhs of :MAKE: now accepts directory names containing path name prefixes. For example:

    :MAKE: ../d1 /actual/path/d2 d3/a

2.3 Special Atoms

2.3.1 New .ALARM Special Atom

.ALARM is an immediate rule atom. It sets an alarm signal in seconds during nmake execution. For example:

    .ALARM : 15

sets an alarm signal 15 seconds after the nmake execution. You can specify interrupt handling for the alarm signal. The value of $(.ALARM) is the absolute time to the next alarm; a value of 0 indicates no alarm.

2.3.2 New .COMPDONE Special Atom

.COMPDONE is a sequence atom. Its action is executed right after the makefile is compiled. .COMPDONE is skipped if the compiled makefile, *.mo, is not changed.

2.3.3 New .INTERRUPT.<signal> Special Atom

This is a sequence atom for handling a specified signal. Signals including SIGILL, SIGIOT, SIGEMT, SIGBUS, and SIGSEGV cannot be caught. Here is an example:

    .INTERRUPT.INT: .MAKE
	    error caught interrupt
	    return 0

    .INTERRUPT.ALRM: .MAKE
	    error caught alarm
    
    .ALARM: 10

    sleep:
	    sleep 30

This example handles an alarm signal that is set for 10 seconds after the nmake execution, and handles any interrupt signals. The return value of the signal hander determines whether processing continues. A return of -1 forces process termination. Repeating alarms can be set by reinitializing .ALARM within the signal handler. For the above example, if we hit the interrupt key twice during the execution, the output will be:

    + sleep 30
    caught interrupt
    caught interrupt
    caught alarm

2.3.4 New .SYNC Special Atom

.SYNC is a new immediate rule atom which is for synchronizing the statefile. It can be used with .ALARM to periodically set a checkpoint to synchronize the statefile for long builds. The usage is:

    .INTERRUPT.ALRM: .MAKE
	    print "Synchronizing Statefile"
	    .SYNC :     
	    .ALARM: 60	/* repetitive alarm */

    .ALARM : 60		/* initial alarm */

This example synchronizes the statefile every 60 seconds.

2.3.5 New .CC.NOOPTIMIZE

This atom eliminates optimization for the local scope, that is, -O is removed from CCFLAGS.

    t1 :: a.c b.c .CC.NOOPTIMIZE
    t2 :: c.c d.c

The t1 will be built without optimization, but t2 will be optimized.

2.4 Edit Operators

2.4.1 Extended Functionality of Edit Operator :A

This edit operator can now select target tokens with specific prerequisite patterns. The syntax is :A>pattern.

    LIST = x y z
    x : a.c b.c
    y : a.c c.x
    z : c.x

    tst :
	    : $(LIST:A>*.c)

produces

    : x y

because the targets x and y have .c files as prerequisites.

2.4.2 Extended Functionality of Edit Operator :F

The :F can now be used to specify format for time output. The syntax is :F=%(format)T. For example:

    t :
	    : $("806273016":F=%(%a %m-%d-%y %H:%M:%S)T)

returns

    : Thu 07-20-95 16:43:36

2.4.3 New Edit Operator :P=B

This edit operator returns physically bound tokens. For example:

    FILES = a.c b.c
    t : a.c
	    : $(FILES:P=B)

produces : a.c since a.c is bound and b.c is not.

2.4.4 New Edit Operator :T=QV

This new edit operator, :T=QV, returns defined variables. For example:

    LIST= A B C
    A==1
    B= b.c

    t :
	    : $(LIST:T=QV)

produces

    : A B

2.4.5 Extended Functionality of Edit Operator :T=R

$("":T=R) now operates on the current date. The time can be printed out by using :F edit operator.

    t :
	    : $("":T=R:F=%(%a %m/%d/%y %H:%M:%S)T)

produces

    : Thu 07/20/95 15:56:14

2.4.6 New Edit Operator :T=Z

The syntax of this new edit operator is :T=Z[CERS]. It returns the time of "cancel", "event", "relative", or "state" for the input token. These times are used during the nmake processing.

    FILE = a.c 
    t :  $(FILE)
	    : $(*:T=ZC:F=%(%a %m-%d-%y %H:%M:%S)T)
	    : $(*:T=ZE:F=%(%a %m-%d-%y %H:%M:%S)T)
	    : $(*:T=ZR:F=%(%a %m-%d-%y %H:%M:%S)T)
	    : $(*:T=ZS:F=%(%a %m-%d-%y %H:%M:%S)T)

The output will be

    + : Wed 12-31-69 19:00:00
    + : Fri 07-21-95 01:29:33
    + : Fri 07-21-95 01:29:33
    + : Thu 07-20-95 14:43:25

There is no cancel time, so the output from the :T=ZC operator indicates the Epoch time. The event time is the time that file a.c is found. The relative time is the current rule time. The state time is the last modification time of a.c, which is recorded in the state file.

2.5 Command Line Options

2.5.1 New -B Command Line Option

This command line option can also be written as -o believe=level, which means to believe the statefile information for in the views >= level are unchanged. This is an optimization for projects that can certify that official files in the views >=level are up to date and have not been changed, while there may be only a few files on the top level and a large number of files on the lower levels. Using the option avoids the stat(2) on the lower level files and saves significant time in some cases.

2.5.2 New Syntax of -M Command Line Option

The syntax of -M is now

    -M{static|dynamic|regress}[:file[:[label][:root]]][,noport][,dontcare].

Here, static is for generating mamfiles, dynamic is for tracing nmake execution steps, and regress is for canonicalizing regression testing on different hosts. Output appends to file. label is the label number prepended to each mam output line (usually the process ID), and root specifies that all files listed are relative to this root directory. noport inhibits porting hints. dontcare lists targets that contain the .DONTCARE special atom.

2.5.3 New -N Command Line Option

This command line option can also be written as -o never, which stands for "never execute." The difference between -n and -N is that -N overrides .ALWAYS.

2.5.4 New -o targetcontext Command Line Options

This new command line option expands actions in the target directory when the target name contains a directory prefix. For instance, if a target has a directory prefix a/b/c.o, then this target will be generated in the context of the prefix directory as

    cd a/b
    <action>

This allows assertions like

    system :: a/b/c.c c/d/c.c

which would normally generate a conflict with ./c.o, but with this option the two c.o files will be generated in the a/b and c/d directories.

2.6 Constructs

2.6.1 New Syntax of print Construct

The print construct is for handling output messages. The syntax of print is

    print -n -u[0-9] -f format [+-]o file data ...

The options are the following: -n adds a trailing null character at the end of output string. -u[0-9] sends output to the file descriptor as specified, that is, 0, 1, and 2 mean stdin, stdout, and stderr. -f format, specifies output format. The format is a C printf-like format string. [+-]o file specifies output file, file. -o file opens file for writing while +o file opens file for appending. data is the output string data.

Here are several examples:

    print -u2 -f "test #1: %s" "output string"

produces the output string, test #1: output string, in stderr.

    print -f "test #2: %s" -o outfile "new output string"

puts the output string, test #2: new output string, into the file called outfile. Note, since print parses options, if you want to print a string of dashes ("-"), you should explicitly mark the end of options by using "--", such as

    print -- ------------------

Also note, +o file will leave the file as append mode. So the subsequent print statement will write output into file as well. You can use

    print -o -

to direct output into stdout again. Here is an example:

    message1 : .MAKE
	    print Running $(<)
	    print +o xxx
	    print this is a test written to xxx

    message2 : .MAKE
	    print this is another test written to xxx 

    message3 : .MAKE
	    print -o -
	    print this message should go to the screen

2.6.2 New Construct: read

The read construct reads input from a file, and then assigns the content of the file to a variable. The syntax is:

    read -i file variable

The -i file is for specifying the input file, where variable is the variable that the contents of file will be assigned to. For example, if infile contains a string of file names, a.c b.c c.c, then,

    read -i infile X

reads the contents of infile, the string of file names, and assigns it to X.

2.7 New cpp #pragma

#pragma pp:plussplice is added for non-standard backslash. In the C++ code such as,

    // comments \
    static int x = 3;

the second line is a part of the comment when this pragma is specified.

2.8 New Variables in probe Information Files

In the "make" part of probe file, CC.ARFLAGS is added for certain compilers that also generate libraries (e.g. Sun's C++ compiler). CC.DIALECT now has the values of DOTI, and TOUCHO. DOTI indicates that the compiler accepts *.i files as preprocessed input. TOUCHO indicates that the compiler may touch *.o files - this supports AT&T's C++ 4.0 translator's implementation of the template instantiation feature. CC.REPOSITORY is also added for the fixed prepository directory name generated by certain compilers, such as Sun's C++ compiler. CC.SUFFIX.[ARCHIVE|COMMAND|OBJECT|SHARED|SOURCE|STATIC] are added to identify different suffixes of file names to associate with different types of files.

2.9 Miscellaneous

2.9.1 Support of AT&T C++ 4.0 and Sun's C++

nmake now supports AT&T's C++ 4.0 and Sun's C++. AT&T's C++ 4.0 puts the instantiated templates back into the .o file. nmake now handles the time stamping change for the instantiated .o files. Sun's C++ compiler does the template instantiation at compile time and generates a fixed directory name for the repository, Template.DB. Sun's C++ compiler also builds archive and shared libraries with instantiated templates information. Now nmake supports all of these special situations.

2.9.2 New tool: ppcc

This tool is located in the bin directory of nmake package. It is the replacement for ccc in nmake 3.0. This tool is automatically used when a compiler does not provide a way to use an alternate cpp. ppcc manages to use cpp to preprocess input files and then hands the output from cpp to the compiler to do the rest of the compilation.

2.9.3 New tool: hostinfo

hostinfo is located in the bin directory of nmake package. It generates host information for coshell. The usage is

    hostinfo [ cpu debug name rating regress type ... ]

For example, on a Sun sparc machine called "agape" running Solaris, the command

    hostinfo name type rating

will return

    agape sol.sun4 20

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

Last Update: Friday,12-Aug-2016 12:29:55 EDT