Rational Developer for System z
PL/I for Windows, Version 7.6, Programming Guide

Inference rules

Inference rules are templates from which NMAKE infers what to do with a description block when no commands are given. Only those extensions defined in a .SUFFIXES list can have inference rules. The extensions .c, .obj, .asm, and .exe are automatically included in .SUFFIXES.

PL/I programmers

You must add PL/I file extensions manually using the .SUFFIXES pseudotarget. See .SUFFIXES Pseudotarget.

When NMAKE encounters a description block with no commands, it looks for an inference rule that specifies how to create the target from the dependent files, given the two file extensions. Similarly, if a dependent file does not exist, NMAKE looks for an inference rule that specifies how to create the dependent from another file with the same base name.

NMAKE applies an inference rule only if the base name of the file it is trying to create matches the base name of a file that already exists.

In effect, inference rules are useful only when there is a one-to-one correspondence between the files with the "from" extension and the files with the "to" extension. You cannot, for example, define an inference rule that inserts a number of modules into a library.

The use of inference rules eliminates the need to put the same commands in several description blocks. For example, you can use inference rules to specify a single pli command that changes any PL/I source file (with a .pli extension) to an object file (with a .obj extension).

You define an inference rule by including text of the following form in your description file or in your TOOLS.INI file — see “Special Features”.

.fromext.toext:
commands
:

The elements of the inference rule are:

fromext
The file-name extension for dependent files to build a target
toext
The file-name extension for target files to be built
commands
The commands to build the toext target from the fromext dependent.

For example, an inference rule to convert PL/I source files (with the .pli extension) to PL/I object files (with the .obj extension) is

.pli.obj:
 pli $<

The special macro $< represents the name of a dependent out-of-date relative to the target.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)