vc 下 makefile和source文件 怎么用

yl_lex072056232 2012-03-07 06:17:32
环境 wdk+intel Composer XE 2011 SP1 + vs2005

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 driver components of the Windows NT DDK
#

!INCLUDE $(NTMAKEENV)\makefile.def

MSC_WARNING_LEVEL=/W1


source文件
TARGETNAME=Lib
TARGETPATH=lib$(BUILD_ALT_DIR)
TARGETTYPE=LIBRARY
DRIVERTYPE=WDM

INCLUDES=$(DDK_INC_PATH); \
..\inc;

SOURCES=Registry.cpp \
pci.cpp \
Adapter.cpp \
Stream.cpp \
Stream.cpp \
Debug.cpp \
WinHalEmu.cpp \
btguids.cpp


USER_C_FLAGS=/TP $(OPTIMIZER_FLAGS)
C_DEFINES=-DMSC -DPNP_POWER



现在 自己写了一个汇编文件.asm.在btcap\lib文件夹下。 想在编译过程成中生成obj文件, 并且obj文件生成到btcap\lib\objchk_win7_amd64\amd64文件夹下,
请问makefile文件和 source文件, 怎么写。
...全文
260 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yl_lex072056232 2012-04-27
  • 打赏
  • 举报
回复
目前我的解决方法是source文件:
TARGETNAME=Lib
TARGETPATH=lib$(BUILD_ALT_DIR)
TARGETTYPE=LIBRARY
DRIVERTYPE=WDM

INCLUDES=$(DDK_INC_PATH); \
..\inc;

TARGETLIBS= \
PciAsm.obj \

SOURCES=Registry.cpp \
pci.cpp \
Adapter.cpp \
Stream.cpp \
Stream.cpp \
Debug.cpp \
PciAsm.asm\
WinHalEmu.cpp \
btguids.cpp


USER_C_FLAGS=/TP $(OPTIMIZER_FLAGS)
C_DEFINES=-DMSC -DPNP_POWER

然后用masm将PciAsm.asm文件编译成obj文件; 当开始build后将pciasm.obj拷贝到需要的目录下, 可以解决。
三楼的方法我试了一下, 我这个还是没有办法解决。。 不过还得谢谢。 呵呵。 希望我的这个能帮到其他人。
5t4rk 2012-03-22
  • 打赏
  • 举报
回复
sources文件

C_DEFINES=/DWIN2K=1
TARGETNAME=MyDriver
TARGETPATH=obj
TARGETTYPE=DRIVER

SOURCES=Driver.c

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 driver components of the Windows NT DDK
#

!INCLUDE $(NTMAKEENV)\makefile.def
wshcdr 2012-03-14
  • 打赏
  • 举报
回复
看起来像是WDK的东西, 直接用WDK的命令行,然后运行 build

21,616

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 驱动开发/核心开发
社区管理员
  • 驱动开发/核心开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧