转自GM,介绍TARGETTYPE的作用,功能!
刚才看了C:/WINCE500/PUBLIC/COMMON/OAK/CSP/ARM/SAMSUNG/S3C2410X/SDHC/SDHC下的sources文件
发现了奇怪的问题,就是它里面没有出现RELEASETYPE
!if 0
Copyright (c) Microsoft Corporation. All rights reserved.
!endif
!if 0
Use of this source code is subject to the terms of the Microsoft end-user
license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
If you did not accept the terms of the EULA, you are not authorized to use
this source code. For a copy of the EULA, please see the LICENSE.RTF on your
install media.
!endif
SYNCHRONIZE_DRAIN=1
TARGETDEFNAME=SDHC_SC2410
DEFFILE=$(TARGETDEFNAME).def
TARGETNAME=$(TARGETDEFNAME)_LIB
TARGETTYPE=LIBRARY
WINCETARGETFILE0=$(_COMMONOAKROOT)/lib/$(_CPUINDPATH)/$(DEFFILE)
PREPROCESSDEFFILE=1
SOURCELIBS=$(_COMMONOAKROOT)/lib/$(_CPUINDPATH)/SC2410_SDHCBase.lib
INCLUDES=../SDHCBase;../../inc
SOURCES = SDIOController.cpp /
RELEASETYPE的作用:
RELEASETYPE:该宏设置两个环境变量RELEASEDIR和RELEASELIBDIR,就是设置编译后生成文件存放的路径。具体值如下:
PLATFORM,生成的文件在PLATFORM/<BSP NAME>/<Target>
LOCAL,生成的文件在当前路径下
CUSTOM,生成的文件在TARGETPATH指定的位置
MANAGED,生成的文件在%_PROJECTROOT%/OAK/<Target>/Managed
OAK, SDK, DDK,生成的文件在%_PROJECTROOT%/Oak/<Target>
——————现在没有,那么他生成的lib放哪里去了呢?
非常神奇的事情是我居然在C:/WINCE500/PUBLIC/COMMON/OAK/LIB/ARMV4I/RETAIL找到了它生成的lib
——到底是在哪里指定了会把生成的lib放在上面的路径的?
还有微软的代码比较奇怪,就是他们都是在sources中指定生成lib,但是最后又不知不觉的的生成DLL了,这个又是怎么实现呢?
就连PXA系列也是如此
!if 0
Copyright (c) Microsoft Corporation. All rights reserved.
!endif
!if 0
Use of this source code is subject to the terms of the Microsoft end-user
license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
If you did not accept the terms of the EULA, you are not authorized to use
this source code. For a copy of the EULA, please see the LICENSE.RTF on your
install media.
!endif
TARGETNAME=pxa27x_sdhc
TARGETTYPE=LIBRARY
INCLUDES=../inc;../xllp/inc
SOURCES = Main.c /
SDControl.c
上面这个也没有RELEASETYPE出现?!!!!!!!!!!!!!!!!!!!!
————————————————————————————————————————————
但是奇怪的是在有些驱动指定了
C:/WINCE500/PUBLIC/COMMON/OAK/CSP/ARM/SAMSUNG/S3C2410X/SERIAL/sources(13):RELEASETYPE=OAK
————————————————————————
!if 0
Copyright (c) Microsoft Corporation. All rights reserved.
!endif
!if 0
Use of this source code is subject to the terms of the Microsoft end-user
license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
If you did not accept the terms of the EULA, you are not authorized to use
this source code. For a copy of the EULA, please see the LICENSE.RTF on your
install media.
!endif
TARGETNAME=s3c2410x_serial
RELEASETYPE=OAK
TARGETTYPE=LIBRARY
INCLUDES=../inc
CDEFINES=$(CDEFINES) -DUSE_NEW_SERIAL_MODEL
SOURCES=pdds3c2410_ser.cpp
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
怎么会这样呢?微软到底是在什么阶段把这个lib变成DLL呢?
还有上面的没有RELEASETYPE又是怎么回事呢?我一定要搞个究竟!!!!!!!!!!!!!
——搞定了。
总结:直接把整个驱动文件夹复制到BSP下,修改sources等文件,RELEASETYPE设置成platform表示是BSP的驱动,会复制生成的DLL到指定的区域,对了把生成的lib改成生成DLL,并且把生成的DLL文件名字改掉,防止和微软下的冲突(有人说会覆盖微软的,这个不没有证实,也许应该做个实验。)然后再根据前面修改reg、bib文件就OK了。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/gooogleman/archive/2008/12/26/3614313.aspx