PATH Command Has No Effect in NMAKELast reviewed: February 15, 1995Article ID: Q76298 |
The information in this article applies to:
SUMMARYIn NMAKE, a command line that changes the operating system PATH command does not affect the other commands that NMAKE processes. This is part of the design behavior of NMAKE. To change the PATH environment variable, use the SET command.
MORE INFORMATIONThe NMAKE documentation provided with Microsoft C version 6.0 and Microsoft Macro Assembler (MASM) version 6.0 state that NMAKE supports any command that you can run at the MS-DOS command prompt. This statement is not entirely true. NMAKE does not emulate the PATH command and ignores it. There are two methods to modify the PATH environment variable in NMAKE. You can create a PATH macro to contain the path to assign to the PATH system variable. The macro name "PATH" must be in uppercase letters. Alternately, you can use the SET command. For example, you could place the following line into a description block: "SET PATH=c:\;c:\dos" (without quotation marks). The following sample makefiles demonstrate these concepts. In the first makefile, the PATH command has no effect. The second and third makefiles demonstrate two methods to modify the PATH, effectively emulating the PATH command entered at the MS-DOS or OS/2 prompt.
Sample Makefile #1# The PATH command has no effect on the contents of the PATH # environment variable. all: path c:\c700\bin; cl /c sample.c Sample Makefile #2# The SET command in this makefile temporarily modifies the PATH # system variable for commands that are processed for the duration # of the makefile. all: set path=c:\c700\bin; cl /c sample.c Sample Makefile #3# The macro called PATH modifies the PATH system variable for the # duration of the makefile. PATH=c:\c700\bin; all: cl /c sample.c |
Additional reference words: kbinf kbinf 1.10 1.20 1.21 1.30 1.40 1.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |