Home    Product Info    Orders    Downloads    About Us    Contact Us


NMAKE Compatibility and Emulation

The following section is from the Opus Make manual, Appendix D.2

Opus Make v6.1x achieves a great deal of compatibility with Microsoft NMAKE. This means Opus Make understands the makefiles of NMAKE without you needing to change anything.

Where something in Opus Make differs from NMAKE we provide emulation. One example difference is in the command line: Opus Make and NMAKE don't have the same command line but with emulation Opus Make handles the NMAKE command-line syntax.

There are also some NMAKE features not supported by Opus Make. Follow the unsupported link.

NMAKE Compatibility [Top]

Opus Make v6.1 is highly compatible with Microsoft NMAKE up to version 1.62 (the version supplied with Visual C++ 5.0). Opus Make supports all NMAKE directives, macros, paths, and rules. As well, Make can be integrated into the Visual C++ IDE.


Opus Make 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 like the "%echo message" directive except that I/O redirection is not allowed.

NMAKE Emulation [Top]

Opus Make is highly compatible with NMAKE but there are differences in how these two read makefiles and in how they run. Opus Make’s NMAKE emulation mode causes Opus Make to operate like NMAKE.

Emulation at Start-Up Time

If NMAKE emulation mode is selected at start-up time, Make emulates the NMAKE command line and selection of the initialization file. Selection of NMAKE emulation at start-up time is done with:

To determine the start-up emulation mode, Make first checks if setem was used to set the start-up emulation to NMAKE. If not, Make examines the OPUSMAKEOPTS environment variable for "–Ex" flags. Make then examines the command-line for "–Ex" flags. If the last "–Ex" flag is "–EN", Make starts up emulating NMAKE.

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

First the OPUSMAKEOPTS environment variable is parsed for options, then the command line is parsed. When Opus Make is emulating NMAKE, parsing entails:

The Emulation File (BUILTINS.NM)

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

The Initialization File (TOOLS.INI)

If Opus Make is emulating NMAKE at start up, Opus Make reads the initialization file:

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

Makefile Contents

If Opus Make is emulating NMAKE:

Sequence Interpretation
^^ literal "^"
^enter literal "enter"
^$ literal "^$"
^\ literal "\"
^# literal "#" (same as Opus’ \#)
VAR = ... $(VAR) ...

are supported and result in $(VAR) being expanded before VAR is redefined. Other macro references in the macro value are not expanded.

ENVVAR = value

where ENVVAR is an environment variable result in the ENVVAR macro getting the value and in the export of value into the environment. Note however that if the "–E" command-line flag was used, makefile macros can’t override environment macros and this macro redefinition is ignored.

all : "VeryLongFileName.exe"
forward.exe : {\src\alpha;d:\proj}pass.obj ...
[{fromdir}].fromext{todir}.toext :
	shell line for inference rule


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

Shell Lines

If Make is emulating NMAKE, the following shell-line features are supported:

all : test1 test2

MACRO = one
test1 :
	echo test1 $(TEST)

MACRO = two
test2 :
	echo test2 $(TEST)

With emulation you get:

test1 one
test2 two

Without emulation you get:

test1 two
test2 two

Other Emulation Features

If Make is emulating NMAKE, the following features are supported:

Inline Response Files

Opus Make supports the NMAKE response file syntax, except that multiple in-line response files on a single shell line are not support.

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

If Opus Make is emulating NMAKE the following occur in inline response files:

Unsupported Features [Top]

Multiple in-line response files on a single shell line are not supported.

Home    Product Info    Orders    Downloads    About Us    Contact Us

Opus Software, Inc. 1032 Irving Street, Suite 439 San Francisco, CA 94122 USA
Phone: 415-485-9703 Fax: 415-485-9704 Email: