The information in this article applies to:
SUMMARY
When NMAKE defines a macro in a makefile, it does not define a
corresponding environment variable for the processes NMAKE invokes.
However, if an environment variable of the same name already exists,
NMAKE reassigns it to have the same value as the macro.
MORE INFORMATION
To create an environment variable in a makefile, use the SET command.
The second sample makefile below demonstrates creating the CL
environment variable if it does not already exist in the inherited
environment.
-or- NTWIN32.MAK, the Win32 application master NMAKE definitions file for the Microsoft Win32 SDK for Windows NT programming samples, contains the macro definition "link=link". Any makefile which has "!include <NTWIN32.MAK>" will fail with LNK1104, if the environment variable 'LINK' is defined. The following warnings for the 32 bit compiler are generated for makefiles which define the MACRO 'cl' if the environment variable 'CL' was also defined: NOTE: If you use NMK.COM instead of NMAKE, you must use the SET command to reassign any environment variables. NMK.COM does not permit you to use macro assignments to override the environment. For more information, query in the Microsoft Knowledge Base on the following words: NMK.COM and environment and macros Sample Makefile #1# If the CL environment variable does not exist, this makefile # compiles and links TEST.C. If the CL environment variable exists, # the makefile changes its value to "/c" and prevents the linker from # running.
Sample Makefile #2# This is a modified makefile from sample 1. Because CL is set with # the SET command, the linker does not run.
Sample Makefile #3# If the LINK environment variable does not exist, this makefile # compiles and links TEST.C. If the LINK environment variable exists, # the makefile changes its value to "link" and the linker error: # LNK1104 or L1093 will be generated.
Additional query words: kbinf 1.20 1.30 1.40 1.50
Keywords : |
Last Reviewed: December 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |