OBJECT_ROOT

The OBJECT_ROOT macro specifies the root where files generated by the Build utility (.obj, .lib, and so on) are stored. The generated files are put in an object tree that is separate from your sources tree.

By default, the Build utility log files are written in the current working directory. To put the log (.log), error (.err), and warning (.wrn) files in another directory, use the -j or -jpath Build utility command options. For more information, see Build Utility Command-Line Parameters and Using Log Files.

By having intermediate object and binary files and the Build utility log files put in a separate root directory outside of the source tree, you preserve the integrity of the default source tree. You can keep your source code immutable or recorded on a CD. For more information, see Specifying the Location of Created Files.

Syntax

OBJECT_ROOT=RootDirectory

Parameters

  • RootDirectory
    This parameter specifies the root directory for your intermediate object and binary files.

Comments

The OBJECT_ROOT macro is enabled automatically when the separate_object_root parameter of SetEnv.bat is specified. For more information about this parameter, see Using the SetEnv.bat Command-Line.

For example, to specify the separate_object_root parameter for the Windows 7 x86 free build environment, follow these steps:

  1. From the Windows Start menu, click Windows Drivers Kit and then click the Windows 7 WDK entry.

  2. Click the Build Environments menu, and then click Windows 7.

  3. Right-click x86 Free Build Environment and select Properties.

  4. Click the Shortcut tab and add the separate_object_root parameter to the end of the Target command for the Build Environment, as shown in the following example:

    C:\Windows\System32\cmd.exe /k C:\WinDDK\bin\setenv.bat C:\WinDDK\ fre x86 WIN7 separate_object_root
    

If the OBJECT_ROOT macro is enabled, the build process puts the intermediate object and binary files in a directory specified by the macro. If the separate_object_root parameter of SetEnv.bat is specified, the OBJECT_ROOT macro is initialized to the following value:

set OBJECT_ROOT=%BASEDIR%.obj

You can customize the current OBJECT_ROOT path by setting it from your Windows Driver Kit (WDK) build environment window by using the set command:

set OBJECT_ROOT = RootDirectory

Example

If you enter the following from your WDK build environment window:

set OBJECT_ROOT=%BASEDIR%.obj

And then build in d:\base\tools\kdexts, the intermediate object and binary files generated by the build process goes to:

%BASEDIR%.obj\base\tools\kdexts\objfre_win7_x86\i386

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011