!INCLUDE <infrules.txt>
!CMDSWITCHES +D
winner.exe:winner.obj
!IFDEF DEBUG
! IF "$(DEBUG)"=="y"
ilink /de winner.obj;
! ELSE
ilink winner.obj;
! ENDIF
!ELSE
! ERROR Macro named DEBUG is not defined.
!ENDIF
The directives in this example do the following:
- The !INCLUDE directive causes the file infrules.txt to be read and evaluated as if it were part of the description
file.
- The !CMDSWITCHES directive turns on the /D option, which displays
the dates of the files as they are checked.
- If winner.exe is out-of-date with respect to winner.obj, the !IFDEF directive checks to see whether the macro DEBUG
is defined. If it is defined, the !IF directive checks to see whether
it is set to y. If it is, the linker is invoked with the /DE option;
otherwise, it is invoked without the /DE. If the DEBUG macro is
not defined, the !ERROR directive prints the message and NMAKE stops
executing.