The Build utility uses numerous environment variables and macros:
- Environment variables are set by the SetEnv.bat batch file when you open a Windows Driver Kit (WDK) build environment window.
- Macros are specified in the sources files. These files must exist in each source code subdirectory.
在Build Utility Macros 跟 Sources File 兩個分類下都有macro的list,不同的是Build Utility Macros分類下除了macro之外也可以用來做環境變數的設定
Build Utility Macros
Sources File
以下是一些巨集的介紹,完整的list要連到MSDN去參考
DEFFILE :
This macro definition specifies the name for the module-definition file (.def), known as an export file, for TARGETNAME.
DLLENTRY :
This macro definition specifies the function that is used as the entry point for a .dll file if the value of TARGETTYPE is set equal to DYNLINK. If no value is given for DLLENTRY, the default value is _DllMainCRTStartup
INCLUDES :
This macro definition specifies additional paths used to find included .h files.
Use this macro only for your private .h file directories because the standard public .h file directories are automatically included. The default value is NULL.
__PROJROOT :
This macro defines the location of a project.
RELEASETYPE :
This macro definition sets two flags: RELEASEDIR and RELEASELIBDIR, which specify which output directory to place binaries and libraries in after they are built.
SOURCELIBS :
This macro definition specifies library (.lib) files to be linked with the module specified in TARGETNAME. The default value is NULL.
SOURCES :
This macro definition contains a list of files that are processed during the build process to become the contents of a library (.lib) file or dynamic-link library (.dll) file.
The list of files consists of assembly files and source files with extensions. These include the following file types: .cxx, .cpp, .c, .asm, .s, .src, .rc, .obj, .ire, .res, .h, .odl, .tlb, .i, .cs, and .resx.
Header files cannot be included in the SOURCES macro definition.
SYNCHRONIZE_DRAIN :
This macro definition allows you to ensure that all preceding library files are built before building the current directory, which depends on the previous libraries.
TARGETLIBS :
This macro definition specifies additional library (.lib) files and object (.obj) files that should be linked into the target executable (.exe or .dll) file.
TARGETNAME :
This macro definition specifies the name of the .exe or .lib file being built, excluding the file name extension.
Build.exe creates a file named Proj2.extension, where extension can be .lib, .dll, or .exe.
TARGETPATH :
When RELEASETYPE equals CUSTOM, TARGETPATH specifies the object directory into which you are building the target device.
TARGETTYPE :
This macro definition specifies the type of file being built. (exe, lib or dll)
這裡有一篇說明提到TARGETTYPE不只這三種,有興趣可以看看 (不清楚在什麼情況下會用到) -> Utilizing a sources File template
WINCEOEM :
If a component needs to use header files and import libraries from the public projects that it depends on, set this macro definition to 1.
This setting means that the component cannot be used across releases of the system.
This macro definition should be set only by system-level components.
0 comments:
Post a Comment