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.libsources dirs makefile makefile.inc makefile.def makefile.plt build.dat objects.mac
BUILD_DEFAULT_TARGETS=-axp64
BUILD_DEFAULT=-eswM -nmake -i
BUILD_OPTIONS=OptDir1 OptDir2would cause build to also process all OptDir1 and OptDir2 directories listed under an OPTIONAL_DIRS section.
BUILD_OPTIONS=~OptDir1 OptDir2would 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.
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.
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
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.
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
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
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
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.
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.
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
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
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 = -DENABLE_FEATURE1to 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
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.
NTPROFILEINPUT=1If you set this value, build.exe expect to find
$(TARGETNAME).prfin the current subdirectory.
See also DLLORDER
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.
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.TARGETPATH=objSee Also TARGETPATHLIB
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 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). |
TARGETNAME=sample TARGETPATH=obj TARGETTYPE=DRIVER TARGETLIBS=$(DDK_LIB_PATH)\videoprt.lib SOURCES=file1.c \
file2.c \
file3.c