Pass 0

After the Build utility has a completed a scan of the project to be built, it starts to build the project. In Pass 0 of the build process, the Build utility produces the source code and binaries that are required for other build passes.

During Pass 0, the Build utility starts the NMAKE utility in any leaf directory that requires source code to be created. NMAKE might call the following tools during Pass 0:

  • The Microsoft interface description language (MIDL) compiler (Midl.exe).

  • The Managed Object Format (MOF) compiler (Mofcomp.exe).

  • The BinPlace utility (Binplace.exe), which puts files that are created during Pass 0.

    The Build utility starts BinPlace during pass 1 if you specify the PASS0_BINPLACE macro in a Sources file.

By default, the build log is stored in the working leaf directory where the Sources file resides. The following example shows the Pass 0 output from a build log:

2>Building generated files in c:\winddk\7063.0\src\hid\firefly\sauron *************
2>'nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS0 NOLINK=1 PASS0ONLY=1 MAKEDIR_RELATIVE_TO_BASEDIR=src\hid\firefly\sauron'
2>BUILDMSG: Processing c:\winddk\7063.0\src\hid\firefly\sauron
2> midl  /Zp8  /IC:\WinDDK\7063.0\inc\atl30 /I..\shared
 /Ic:\winddk\7063.0\internal\WDKSamples\inc /IC:\WinDDK\7063.0\inc\api 
 /IC:\WinDDK\7063.0\inc\api /IC:\WinDDK\7063.0\inc\crt  /char unsigned  /ms_ext  /c_ext  /proxy 
 c:\winddk\7063.0\src\hid\firefly\sauron\objfre_win7_x86\i386\effects_p.c  /dlldata 
 c:\winddk\7063.0\src\hid\firefly\sauron\objfre_win7_x86\i386\dlldata.c  /iid 
 c:\winddk\7063.0\src\hid\firefly\sauron\objfre_win7_x86\i386\effects_i.c  /tlb 
 c:\winddk\7063.0\src\hid\firefly\sauron\objfre_win7_x86\i386\effects.tlb  /header 
 c:\winddk\7063.0\src\hid\firefly\sauron\objfre_win7_x86\i386\effects.h  /cpp_cmd
 /DNTDDI_VERSION=0x06010000  /Di386 /D_X86_ /D_WCHAR_T_DEFINED /no_stamp /nologo    -sal /win32 -target NT60  effects.idl

This example illustrates the following points:

  • The Build utility runs NMAKE and specifies that the BUILD_PASS is PASS0 and the current folder is sauron. The parameters to NMAKE are determined from rules in the Makefile.def and Sources files of the project.

  • The "2>" at the beginning of some lines in the example indicates a thread number for the NMAKE process. In this example, the Build utility was run on a multiprocessor computer and used multiple threads. All the threads write to the same build log file. In a full build log on a multiprocessor computer, you will see multiple tasks interleaved. You can use the thread numbers at the beginning of the line numbers to identify the interleaved tasks.

  • NMAKE calls MIDL compiler with the correct parameters and the files to be generated. In this example, these files include the .c/.h/.tlb files for the effects and isauron modules.

When the Build utility completes all the Pass 0 tasks for a project source tree, it moves on to Pass 1.



Send comments about this topic to Microsoft

Build date: 5/3/2011