Previous Next

Specifying the Location of Created Files

The location of the files produced by the Build utility depends on the value of certain environment variables and sources macros. In most cases, you will want to accept the default locations determined by the DDK build environments.

Libraries are placed in a subdirectory of the root directory of the DDK installation (BASEDIR). The subdirectory for libraries is three levels beneath the DDK installation directory, in the following path:

lib\Version\Cpu

Object files are placed in a subdirectory of the root directory where the binaries are being built. The subdirectory's name always begins with obj, unless you have changed the value of TARGETPATH in your sources file to some other string (which is not recommended). This subdirectory is given the following name:

objType_Version_Cpu

The build logs are placed in the current directory, unless you specify a different directory with the -j command-line switch. There are three build log files: the command log, the warning log, and the error log. These files are given the following names:

buildType_Version_Cpu.log
buildType_Version_Cpu.wrn
buildType_Version_Cpu.err

The elements of these directory and file names are as follows:

Version
Indicates the version of Windows supported by the build environment: w2k for Windows 2000, wxp for Windows XP, or wnet for Windows Server 2003.
Cpu
Indicates the processor. For an x86 processor, this is i386 when used in the path for library files, or x86 when used in the directory for object files or in the build log file name. For an Itanium-based processor, this is ia64. For an AMD x86-64 processor, this is amd64.
Type
Indicates the build type: fre in the free build environment or chk in the checked build environment.

For example, if you are building x86 binaries for Windows XP in the free build environment, the library files will be placed under BASEDIR in the subdirectory lib\wxp\i386, the object files will be placed under the build directory in the subdirectory objfre_wxp_x86, and the build logs will be placed in the current directory and given the file names buildfre_wxp_x86.log, buildfre_wxp_x86.wrn, and buildfre_wxp_x86.err.

Object file directories and log file names both contain the string Type_Version_Cpu. This string is stored in the build environments as the environment variable BUILD_ALT_DIR. You can change this variable if you want to change the value of this string.

Because output files are placed in subdirectories that are specific to the build environment, you can keep your source files in a single directory tree and maintain free and checked build products for a variety of platforms under this one tree.

When building a DLL, you create not only the DLL itself, but also an import library that other images can use to reference functions that the DLL exports. In this situation, you might want to place the .obj files created for the DLL into a different directory from the .lib and .exp files. The macro TARGETPATHLIB specifies a location for .lib and .exp files created for DLLs. If you set TARGETPATHLIB to a different directory than TARGETPATH, you can put the DLL binary in one directory and place the .lib and .exp files in a different directory, where they will be available to other components. TARGETPATHLIB has no effect on binaries that are not DLLs.