当前位置:编程学习 > 网站相关 >>

webkit在win32下的编译规则(六)

 WebCore Folder下面的有3个工程:QTMovieWin,WebCore,WebCoreGenerated,编译的顺序是:WebCoreGenerated-》QTMovieWin-》QTMovieWin。

首先来看WebCoreGenerated这个工程,这个工程的NMake Build Comand Line如下:

%SystemDrive%cygwininwhich.exe bash
if errorlevel 1 set PATH=%SystemDrive%cygwinin;%PATH%
cmd /c
if exist "$(ConfigurationBuildDir)uildfailed" grep XX$(ProjectName)XX "$(ConfigurationBuildDir)uildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(ConfigurationBuildDir)uildfailed"

set CONFIGURATIONBUILDDIR=$(ConfigurationBuildDir)
bash build-generated-files.sh "$(ConfigurationBuildDir)" "$(WebKitLibrariesDir)" "$(WebKitVSPropsRedirectionDir)......WebKitLibrarieswin" cairo
bash migrate-scripts.sh "$(ConfigurationBuildDir)/obj/WebCore/scripts"
cmd /C copyForwardingHeaders.cmd cairo curl
cmd /C copyInspectorFiles.cmd

if exist "$(ConfigurationBuildDir)uildfailed" del "$(ConfigurationBuildDir)uildfailed"

比较重要的是下面四句:

bash build-generated-files.sh "$(ConfigurationBuildDir)" "$(WebKitLibrariesDir)" "$(WebKitVSPropsRedirectionDir)......WebKitLibrarieswin" cairo
bash migrate-scripts.sh "$(ConfigurationBuildDir)/obj/WebCore/scripts"
cmd /C copyForwardingHeaders.cmd cairo curl
cmd /C copyInspectorFiles.cmd

首先来看build-generated-files.sh:

build-generated-files.sh

这个脚本比较重要的是倒数两句。倒数第二句将vsprops里面的值转换为FEATURE_DEFINES这个环境变量。倒数第一句调用make来编译$WebCore/DerivedSources.make (D: oolscygwinhomexufanWebKitSourceWebCoreDerivedSources.make)这个文件,-j选项同时进行编译的任务数(多核很有优势)。DerivedSources.make的文件内容如下:

DerivedSources.make

VPATH这个变量定义了Make在哪里寻找文件,使用VPATH有一个隐患: VPATH在每个目录中搜索所有的source文件,如果一个相同的文件名出现在不同的目录中, VPATH将第一个搜索到的文件作为结果,使用vpath就比VPATH更灵活些。不够webkit暂时没出这个问题,所以VPATH已经够用。后面很多规则没有指定路径,靠的就是这个VPATH,将路径展开交给了make工具。
DOM_CLASSES定义了一大堆要根据IDL文件生成的h和cpp文件列表,大概有450个,生成的文件在D: oolscygwinhomexufanWebKitWebKitBuildDebug_Cairo_CFLiteobjWebCoreDerivedSources目录下。

JS_DOM_HEADERS将所有的DOM_CLASSES值加了JS前缀,并去除了其中的JSMediaQueryListListener.h JSEventListener.h JSEventTarget.h这几个文件。

WEB_DOM_HEADERS在编译选项中包括BUILDING_WX时,将所有的DOM_CLASSES值加了WebDOM前缀,并去除了其中的WebDOMXSLTProcessor.h WebDOMEventTarget.h。在cairo win32编译环境下,这个变量为空。

makefile的入口是all这条规则,all依赖于$(JS_DOM_HEADERS),$(WEB_DOM_HEADERS),JSJavaScriptCallFrame.h,CSSGrammar.cpp,CSSPropertyNames.

h,CSSValueKeywords.h,ColorData.cpp,DocTypeStrings.cpp,HTMLElementFactory.cpp,HTMLEntityTable.cpp,

HTMLNames.cpp,WMLElementFactory.cpp,WMLNames.cpp,JSSVGElementWrapperFactory.cpp,

SVGElementFactory.cpp,SVGNames.cpp,UserAgentStyleSheets.h,XLinkNames.cpp,XMLNSNames.cpp,

XMLNames.cpp,MathMLElementFactory.cpp,MathMLNames.cpp,XPathGrammar.cpp,tokenizer.cpp,

HeaderDetection.h,下面就介绍makefile如何对这些文件进行处理

补充:综合编程 , 其他综合 ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,