The TARGET_DIRECTORY should always be equal to the target platform type — i386 for an x86 processor, ia64 for an Itanium-based processor, or amd64 for an AMD x86-64 processor.
Use the TARGET_DIRECTORY macro as follows to specify the target directory, if you want some dependency file to always end up in the obj subdirectory:
TARGET_DIRECTORY=some_sourcefile:some_dependency_file
This instruction enables you to draw upon resources contained in a single source tree to complete multiple platform-specific builds without conflicts. You do not have to hard-code the name of the platform.
For example, if you have a special Build utility rule for some feature in your code, or if you want to build a particular object from a particular C file, you can use the following line in a sources file:
obj\$(TARGET_DIRECTORY)\filename.obj; filename.c
Using the TARGET_DIRECTORY macro ensures that the specified file will be placed in the appropriate subdirectory. For example, \obj\i386subdirectory\obj\.
There are some default targets. One of them is .cod. If you issue the following instruction from a subdirectory containing source files:
nmake SOURCE_FILE_NAME=.cod
it will create an assembler listing that you can review to determine the location of the compiler error.
There is another default target called .pp file, a preprocessed listing. Preprocessing adds line numbers. You can use these line numbers to determine whether the Build utility retrieved headers from the correct location, and which #define directives and structures it added.
If you issue the following instruction from a subdirectory containing source files:
nmake SOURCE_FILE_NAME=.pp
the Build utility will preprocess the file.
The .cod and .pp files are very useful for tracking bugs in the build process.