1)文件 my_build.bat
注意:其中BASEDIR在系统环境变量中已经设置过了,路径设置为WDK安装的目录
- @echo on
- @echo %1 is chk or fre %2 is WXP or W2K or WNET.
- if "%4"=="/a" call my_clean %1 %2
- pushd.
- call %BASEDIR%\bin\setenv.bat %BASEDIR% %1 %2
- popd
- @echo on
- build
2) 执行编译命令
my_build chk WNET编译调试版
my_build fre WNET编译发行版
注意:chk WNET实际上就是上面bat文件中指定的%1 %2
E:\source_code\comcap>my_build chk WNET
chk is chk or fre WNET is WXP or W2K or WNET.
E:\source_code\comcap>if "" == "/a" call my_clean chk WNET
E:\source_code\comcap>pushd.
E:\source_code\comcap>call c:\WINDDK\7600.16385.1\bin\setenv.bat c:\WINDDK\7600.
16385.1 chk WNET
Launching OACR monitor
E:\source_code\comcap>build
3)SOURCES
TARGETNAME=comcap
TARGETPATH=obj
TARGETTYPE=DRIVER
SOURCES =comcap.c
TARGETLIBS= $(DDK_LIB_PATH)\ntstrsafe.lib
因为用到RtlStringCchPrintfW函数,所以必须包含TARGETLIBS= $(DDK_LIB_PATH)\ntstrsafe.lib这句话
阅读(4629) | 评论(0) | 转发(0) |