The TOOLS.INI File

You can customize NMAKE by placing commonly used information in the TOOLS.INI initialization file. Settings for NMAKE must follow a line that begins with the tag [NMAKE]. The tag is not case sensitive. This section of the initialization file can contain any makefile information. NMAKE uses this information in every session, unless you run NMAKE with the /R option. NMAKE looks for TOOLS.INI first in the current directory and then in the directory specified by the INIT environment variable.

You can use the !CMDSWITCHES directive to specify command-line options in TOOLS.INI. An option specified this way is in effect for every NMAKE session. This serves the same purpose as does an environment variable, which is a feature available in other utilities. For more information on !CMDSWITCHES, see topic .

Macros and inference rules appearing in TOOLS.INI can be overridden. See “Precedence among Macro Definitions” and “Precedence among Inference Rules”.

NMAKE reads information in TOOLS.INI before it reads makefile information. Thus, for example, a description block appearing in TOOLS.INI acts as the first description block in the makefile; this is true for every NMAKE session, unless /R is specified.

To place a comment in TOOLS.INI, specify the comment on a separate line beginning with a semicolon (;). You can also specify comments with a number sign (#) as you can in a makefile; for more information, see “Comments”.

Example

The following is an example of text in a TOOLS.INI file:

[NMAKE]

; macros

CC = qcl

CFLAGS = /Gc /Gs /W3 /Oat

; inference rule

.c.obj:

$(CC) /Zi /c $(CFLAGS) $*.c

NMAKE reads and applies the lines following [NMAKE]. The example redefines the macro CC to invoke the Microsoft QuickC Compiler, defines the macro CFLAGS, and redefines the inference rule for making .OBJ files from .C sources. These NMAKE features are explained throughout this chapter.