1、在开始菜单中选择合适的Build Environments(选择的Build Environment一定要和编译好的驱动运行的平台相同),这一步就会在打开的cmd窗口中设置好环境变量。
2、从DDK示例源代码目录拷贝makefile文件到你的驱动源文件目录中,并建立sources文件(可根据msdn帮助文件中的sources模板文件修改),其中makefile文件模板一般不用修改,修改sources文件为自己所需要的,如何修改sources文件可参考msdn帮助文件。
3、在1中打开的cmd窗口中cd到源代码目录,执行build -ceZ命令即可。
附:makefile及sources标准模板
1)makefile:
#
# DO NOT EDIT THIS FILE!!! Edit ./sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the components of Windows NT
#
!INCLUDE $(NTMAKEENV)/makefile.def
2)sources:
/*****************************************************************
* Using this sources template
* 1、Copy the contents of this topic to the Clipboard.
* 2、Paste this topic into a file using a text editor.
* 3、Replace the xxxxx in the TARGETNAME macro with your target name. For example:
*