Example
!INCLUDE <INFRULES.TXT>
!CMDSWITCHES +D
WINNER.EXE:WINNER.OBJ
!IFDEF DEBUG
! IF "$(DEBUG)"=="y"
LINK /CO WINNER.OBJ;
! ELSE
LINK 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 /CO option; otherwise, it is invoked
without the /CO. If the DEBUG macro is not defined, the !ERROR directive
prints the message and NMAKE stops executing.
[Back: Directives]
[Next: Pseudotargets]