Makefile.def File

The Build utility uses a generic make file that is named Makefile.def. Starting with the Windows Driver Kit (WDK) for Windows Vista, the Makefile.def file is used to do the following tasks:

  • Specify the macro settings that are used for operating system-specific builds.

  • Redirect the Build utility to the Makefile.new file, which specifies the macro settings that are passed to the compiler and linker. The directives in the Makefile.new file also start NMAKE to build the dependencies that are specified in the Sources file.

Note  In versions of the WDK prior to Windows Vista, the Makefile.def file contained all the macro settings and directives that the Makefile.new file currently contains.

The Build utility processes Makefile.def in one of the following ways:

  • Indirectly though an !INCLUDE directive within the Makefile file.

    Note  If your project uses a Makefile file, that file must contain an !INCLUDE directive to redirect the Build utility to the Makefile.def file.

  • By default, if the Makefile file is not found in the project.

    Note   Starting with the Windows Driver Kit (WDK) for Windows Vista, it is no longer required for the Makefile file to be in every project.

Using the Build utility along with the Makefile.def and Makefile.new files removes the question about which compiler switches are required, which arguments that the linker requires, and so on. By adding appropriate macro definitions to the Sources file, you can control build options in a platform-independent manner.

Under the root installation directory of the Windows Driver Kit (WDK), Makefile.def is stored in the bin subdirectory.

Caution   Do not change Makefile.def or any of the other files in the WDK's \bin directory. If you have driver-specific make file requirements, put them in Makefile.inc instead

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011