PRB: Last Letter of NMAKE Command-Line Macro Incremented

ID Number: Q79824

1.13 | 1.13

MS-DOS | OS/2

Summary:

SYMPTOMS

When defining a macro on the command line of NMAKE version 1.13,

the last letter of a macro string may be incremented by one letter.

Every other letter, beginning with the letter "b", is incremented

in this manner. For example, the following makefile will expand the

macro DIR to be XXY instead of XXX.

RESOLUTION

Use one of the following workarounds to resolve the problem:

1. Use the /F command-line option to specify the name of the

makefile. For example:

nmake /F test.mak DIR=XXX

-or-

nmake DIR=XXX /F test.mak

2. Place any command-line option after the macro definition.

For example:

nmake DIR=XXX /A test.mak

3. Define the macro within the makefile instead of on the command line.

More Information:

This problem occurs only when a makefile with a name other than the

default name of MAKEFILE is specified on the command line without the

/F command-line option. This option should be used anytime a

nondefault makefile name is used. See page 292 of the "Microsoft Macro

Assembler Programmer's guide."

Sample Code

-----------

/* Command line: nmake DIR=XXX test.mak

*/

ALL:

ECHO $(DIR)

Additional reference words: character change