D.2 Microsoft NMAKE Compatibility

omake is highly compatible with Microsoft NMAKE up to version 1.3 (the version supplied with Visual C++). omake supports all NMAKE directives, macros, paths, and rules.

NMAKE Directives

omake supports the following NMAKE directives:

!CMDSWITCHES {+|- } opt

This read-time directive turns on (+) or off (-) one or more options, opt.

!message message

This read-time directive is the same as the %echo message directive.

NMAKE Emulation

omake is highly compatible with NMAKE, but there are differences in how they read makefiles and in how they run. omake's NMAKE emulation mode causes omake to operate like NMAKE.

Emulation at Startup Time

If NMAKE emulation mode is selected at startup time, omake emulates the NMAKE command line and selection of the initialization file. Selection of NMAKE emulation at startup time is done with the -EN flag, either on the command line or in the OMAKEOPTS environment variable.

To determine the startup emulation mode, omake first examines the OMAKEOPTS environment variable for -Ex flags, and then the command-line for -Ex flags. If the last -Ex flag is -EN, omake starts up emulating NMAKE.

NOTE: If you want submakes (recursive invocations of omake) to inherit NMAKE emulation mode, you must specify the -EN flag in the OMAKEOPTS environment variable.

Emulation After Start-Up Time

The .MS_NMAKE directive turns on NMAKE emulation mode from the point it appears in the initialization file or any makefile.

The Command Line

The OMAKEOPTS environment variable is parsed for options, and then the command line is parsed. Parsing entails the following:

Without emulation at startup, the command line is as documented in the section Command-Line Options.

The Emulation File (BUILTINS.NM)

If omake is emulating NMAKE at startup, omake reads its internal rules and macros, and then looks for builtins.nm in the directory of make.ini, in the directory of the omake.exe file, and along directories of the INIT environment variable, in that order. If builtins.nm is found, it is read for macros and rules that give more complete NMAKE emulation.

The Initialization File (TOOLS.INI)

If omake is emulating NMAKE at startup, omake reads the tools.ini file found in one of these directories:

If omake finds the initialization file, it reads information in the file starting with the section heading [NMAKE.

Makefile Contents

If omake is emulating NMAKE:

Macros

If omake is emulating NMAKE, the following macro features are supported:

Build Scripts

If omake is emulating NMAKE, the following build-script features are supported:

Inline Response Files

omake supports the NMAKE response file syntax, except that multiple inline response files on a single build script are not support.

NMAKE and omake allow the keywords KEEP or NOKEEP in the epilog of the inline response file. KEEP causes the response file to be kept (that is, not deleted). The default is NOKEEP.

Unsupported NMAKE Features

Multiple inline response files on a single build script are not supported.

Arithmetic operators are not supported in preprocessing expressions.