BASEDIR

The BASEDIR macro refers to the base of the source tree. By default,
    BASEDIR=$(_NTDRIVE)$(_NTROOT)
The following three statements are equivalent, but using the third one is recommended.
    TARGETLIBS=d:\nt\public\sdk\lib\*\kernel32.lib
    TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib
    TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib
sources dirs makefile makefile.inc makefile.def makefile.plt build.dat objects.mac

BUILD_DEFAULT_TARGETS

This envirnoment variable specifies the platform for which you are building. This variables allows the possibly of cross platform compilation, when such compilers are available. Here is an exmaple of this environment variable:
    BUILD_DEFAULT_TARGETS=-axp64

BUILD_DEFAULT

This envirnoment variable specifies the default options used by build.exe Here is an example of this environment variable:
    BUILD_DEFAULT=-eswM -nmake -i

BUILD_MAKE_PROGRAM

This envirnoment variable specifies the default program make executed by build.exe to in order to compile a directory. The default value of this environment variable should be nmake.exe.

BUILD_OPTIONS

By default, build.exe will traverse the entire source tree, processing the directories listed in the DIRS section of the dirs file. This envirnoment variable specifies which of the optional directories, listed under OPTIONAL_DIRS should be processed by build.exe Here are some examples of this environment variable:
    BUILD_OPTIONS=OptDir1 OptDir2
would cause build to also process all OptDir1 and OptDir2 directories listed under an OPTIONAL_DIRS section.
    BUILD_OPTIONS=~OptDir1 OptDir2
would cause build to all OptDir2 directories listed under an OPTIONAL_DIRS section, but force it to skip over all OptDir1 directories, whether listed in the DIRS or OPTIONAL_DIRS section of a dirs file.

CRT_INC_PATH

This envirnoment variable specifies the location of the C Runtime header files. The default value of this macro is:

    $(BASEDIR)\public\sdk\inc\crt

Set this macro in your environment variables if you wish to override the default location of the C Runtime header files.
This macro should no be redefined from within a sources file.

CRT_LIB_PATH

This envirnoment variable specifies the location of the C Runtime libraries. The default value of this macro is:

    $(BASEDIR)\public\sdk\lib\crt

Set this macro in your environment variables if you wish to override the default location of the C runtime libraries.
This macro should no be redefined from within a sources file.

Here is an example of the usage of this macro:

    TARGETLIB=$(CRT_LIB_PATH)\libcntpr.lib \
$(SDK_LIB_PATH)\advapi32.lib

DDK_INC_PATH

This macro specifies the location of the DDK header files. The default value of this macro is:

    $(BASEDIR)\public\ddk\inc

Set this macro in your environment variables if you wish to override the default location of the DDK header files.
This macro should no be redefined from within a sources file.

DDK_LIB_DEST

This macro specifies the destination location of a DDK library. The default value of this macro is:

    $(BASEDIR)\public\ddk\lib\*

Set this macro in your environment variables if you wish to override the default location of the DDK libraries.
This macro should no be redefined from within a sources file.

Here is an example of the usage of this macro:

    TARGETPATHLIB=$(DDK_LIB_DEST)\ndis.lib

DDK_LIB_PATH

This macro specifies the location of the DDK libraries. The default value of this macro is:

    $(BASEDIR)\public\ddk\lib

Set this macro in your environment variables if you wish to override the default location of the DDK libraries.
This macro should no be redefined from within a sources file.

Here is an example of the usage of this macro:

    TARGETLIB=$(DDK_LIB_PATH)\ndis.lib \
$(DDK_LIB_PATH)\tdikrnl.lib

DDK_LIB_PATH

This macro specifies the location of the DDK libraries. The default value of this macro is:

    $(BASEDIR)\public\ddk\lib

Set this macro in your environment variables if you wish to override the default location of the DDK libraries.
This macro should no be redefined from within a sources file.

Here is an example of the usage of this macro:

    TARGETLIB=$(DDK_LIB_PATH)\ndis.lib \
$(DDK_LIB_PATH)\tdikrnl.lib

MASTER_VERSION_FILE

This macro contains the name of the master version file for Windows 2000. It contains, among other things, the default operating system version number which all binaries should have defined in the resource section. The default value of this variable is $(SDK_INC_PATH)\ntverp.h You should not override this value in your environment variables unless your component is not integrated in the Windows 2000 product (please contact BryanT for more information).

OAK_INC_PATH

This macro specifies the location of the OAK header files. The default value of this macro is:

    $(BASEDIR)\public\oak\inc

Set this macro in your environment variables if you wish to override the default location of the OAK header files.
This macro should no be redefined from within a sources file.

PRIVATE_INC_PATH

This macro specifies the location of the private windows 2000 header files. The default value of this macro is:

    $(BASEDIR)\private\inc

Set this macro in your environment variables if you wish to override the default location of the private windows 2000 header files.
This macro should no be redefined from within a sources file.

SDK_LIB_DEST

This macro specifies the destination location of a SDK library. The default value of this macro is:

    $(BASEDIR)\public\sdk\lib\*

Set this macro in your environment variables if you wish to override the default location of the SDK libraries.
This macro should no be redefined from within a sources file.

Here is an example of the usage of this macro:

    TARGETPATHLIB=$(SDK_LIB_DEST)\kernel32.lib

SDK_LIB_PATH

This macro specifies the location of the SDK libraries. The default value of this macro is:

    $(BASEDIR)\public\sdk\lib

Set this macro in your environment variables if you wish to override the default location of the SDK libraries.
This macro should no be redefined from within a sources file.

Here is an example of the usage of this macro:

    TARGETLIB=$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\advapi32.lib

WDM_INC_PATH

This macro specifies the location of the WDM header file. The default value of this macro is:

    $(BASEDIR)\public\ddk\inc\wdm

Set this macro in your environment variables if you wish to override the default location of the WDM header files.
This macro should no be redefined from within a sources file.

C_DEFINES - optional

Use this macro to specify switches you want passed to the compiler. Typically, they are compiler #defines. You might specify:
    C_DEFINES = -DENABLE_FEATURE1
to define ENABLE_FEATURE1 to the compiler. C_DEFINES gets passed to both the C compiler and the MIDL compiler. Therefore, you cannot put compiler optimization or other machine or tool specific switches in the C_DEFINES macro. Use MSC_OPTIMIZATION for C compiler only optimizations See also ASM_DEFINES, RC_DEFINES

DLLORDER - optional

When you are building a DLL, you can specify an order file that will be passed to the linker. This order file lists the order in which functions should be layed out in the image. This is the same as NTPROFILEINPUT except that a full name for the profile can be specified.

EXEPROFILEINPUT - obsolete

Use NTPROFILEINPUT instead.

INCLUDES - optional

Build.exe use a default list of public include directories from which to search for header files. The default list of include directories is dependent on the value of TARGETTYPE in the sources file.

Use the INCLUDES macro to indicate an additional list of private include directories to be searched for include files during compilation. Separate the entries in this list with a semicolon. Path names can be absolute or relative.

For example:
    INCLUDES=..\inc;..\..\inc

    INCLUDES=$(INCLUDES); \
             h;           \
             ..\headers;
The INCLUDES macro is read by build.exe and passed to the MAKE program. The list of directories in the INCULDES macro will have precedence over the default include directories.

MAJORCOMP - obsolete

Please remove from your sources file

MINORCOMP - obsolete

Please remove from your sources file

NO_NTDLL - optional

Set this macro to 0 to force your binary not to link against NTDLL.LIB.

NTPROFILEINPUT - optional

When you are building a DLL, you can specify an order file that will be passed to the linker. This order file lists the order in which functions should be layed out in the image. To use the profile, specify the following in your sources file:
    NTPROFILEINPUT=1
If you set this value, build.exe expect to find
    $(TARGETNAME).prf
in the current subdirectory.

See also DLLORDER

PNP_POWER - obsolete

Please remove from your sources file

SOURCES - required

The SOURCES macro is the most important macro in a sources file. It specifies the list of files to be compiled. Build.exe will look at these files and generate a dependency list. For any source file whose dependencies changed, build.exe will rebuild this file.

Use this macro to list your source filenames (except for the file containing main in the case where UMAPPL or UMTEST is used. Include the filename extension and separate the entries in this list with spaces or tabs.

TARGETEXT - optional

Set this macro to specify the extension name (such as .cpl) when you want your binary to have something other than the default extension generated by TARGETTYPE. If you specify something unexpected, you will see a message "Unexpected Target Ext." If you want an extension added to the Build Utility, contact Bryan Tuttle (bryant).

TARGETLIBS - required

Set this macro to specify the set of libraries with which your final image must be linked.

If your components generates a library (.lib) and this library must link in code from other libraries, use the LINKLIBS macro. Use LINKLIBS only for the case that meets the following conditions: You are building a dynamic link. You are exporting something that's defined in some other component library that you also build. In your dirs file in the subdirectory above, you have ordered it so that the component libraries are around before you build the dynamic link. There is a similar macro called UMLIBSUMLIBS that you can use if you are building UMAPPLs.

TARGETNAME - required

Use this macro to specify the name of the binary being built, excluding the filename extension. You must have this macro in your sources file.

TARGETPATH - required

Use this macro to specify the target directory in which the resulting binary will be placed. Notice that object files always end up in the obj subdirectory. Object file can only be generated in the $(O) directory. You must have this macro in your sources file. For example:
    TARGETPATH=obj
See Also TARGETPATHLIB

TARGETPATHLIB - optional

Set this value to specify where to put the import library associated with this binary.
When you are building a DLL, you create the DLL itself and you create an import library that other images can use to reference functions exported by your DLL.
    TARGETPATHLIB=$(SDK_LIB_PATH)mydll.lib

Setting TARGETPATH independently from TARGETPATHLIB allows the binary to be kept in the current directory, while the .lib and .exp files can be shared with other components.

TARGETTYPE - required

Use this macro to specify the type of binary being built. This is typically LIBRARY or DYNLINK (for DLLs), but can take other values. This is a required field in the sources file. TARGETTYPE allows build.exe to select appropriate defaults for include paths and link options. You must have this macro in your sources file. The valid values for TARGETYPE include:
TARGETTYPE values File Extension Description
PROGLIB .exe Executable program which also exports functions for other programs.
PROGRAM .exe Simple user mode program.
DYNLINK .dll Dynamic Link Library (dll).
LIBRARY .lib Component library whose code will be linked into another binary (such as a dll).
DRIVER_LIBRARY .lib Component library for a driver. The only difference with the LIBRARY type is that the default header file include path is different.
DRIVER .sys Kernel mode driver.
EXPORT_DRIVER .sys Kernel mode driver which also exports routines other drivers can link against and call.
HAL .dll Hardware Abstraction Layer (HAL)
BOOTPGM .exe Kernel mode driver.
MINIPORT .sys Kernel mode driver which does not link against ntoskrnl.lib or hal.lib.
GDI_DRIVER .dll Kernel mode driver which only links against win32k.sys (Display or print driver).

UMAPPL

UMAPPLEXT

Use this macro to specify the extension name (for example .COM or .SCR) that will be appended to the name specified in UMAPPL. Use UMAPPLEXT when you want the extension to be something other than .exe. Contact Bryan Tuttle if you need to add a new type of extension.

UMLIBS

UMTEST

Sample Driver Sources File

TARGETNAME=sample
TARGETPATH=obj
TARGETTYPE=DRIVER

TARGETLIBS=$(DDK_LIB_PATH)\videoprt.lib

SOURCES=file1.c \
file2.c \
file3.c