NMAKE Help (nmake.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Using Macros
◄Up► ◄Contents► ◄Index► ◄Back►
─────NMAKE──────────────────────────────────────────────────────────────────
To invoke, or use, a macro, enclose its name in parentheses
preceded by a dollar sign ($), as follows:
$(macroname)
No spaces are allowed. Macros are case sensitive. If <macroname>
is null or undefined, it is replaced by a null string. Parentheses
are optional if <macroname> is a single character. However, they
are recommended for consistency and to avoid possible errors.
You can invoke a macro to substitute text within another macro.
See: ◄Null Macros and Undefined Macros►
◄Substitution Within Macros►
Example
program = sample
L = LINK
OPTIONS =
$(program).exe : $(program).obj
$(L) $(OPTIONS) $(program).obj;
This makefile defines and uses three macros. NMAKE interprets the
description block as
sample.exe : sample.obj
LINK sample.obj;
NMAKE replaces every occurrence of $(program) with sample, every
instance of $(L) with LINK, and every instance of $(OPTIONS) with
a null string.
-♦-