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

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

现在的webkit分为4个Floder:Javascript Folder,Tools,WebCore Folder,Webkit2 Folder,WebkitCom Folder,这5个目录的编译顺序基本是:Javascript Folder-》WebCore Folder-》WebkitCom Folder-》Webkit2 Folder-》Tools(有些子工程的顺序并不是这样的),下面就以这几个目录为单位来说明webkit的编译规则。

 

1. Javascript Folder

这个目录下有5个工程:JavaScriptCore, JavaScriptGenerated, jsc, testapi, WTF。编译顺序是:JavaScriptGenerated-》WTF-》 JavaScriptCore-》testapi-》jsc。testapi和jsc其实是在比较后面编译的,应为它们依赖于Tools下的FindSafari工程。

首先看JavaScriptGenerated的工程属性,可以看到这个工程是用nmake编译的,如下图:

 

JavaScriptGenerated的工程文件在D: oolscygwinhomexufanWebKitJavaScriptCoreJavaScriptCore.vcprojJavaScriptC

oreJavaScriptCoreGeneratedCommon.vsprops,内容如下:

<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
 ProjectType="Visual C++"
 Version="8.00"
 Name="JavaScriptCoreGeneratedCommon"
 OutputDirectory="$(WebKitOutputDir)lib"
 IntermediateDirectory="$(WebKitOutputDir)obj$(ProjectName)$(ConfigurationName)"
 >
 <Tool
  Name="VCNMakeTool"
  BuildCommandLine="%SystemDrive%cygwininwhich.exe bash
if errorlevel 1 set PATH=%SystemDrive%cygwinin;%PATH%
cmd /c

nmake /nologo -f JavaScriptCoreGenerated.make"
  ReBuildCommandLine="%SystemDrive%cygwininwhich.exe bash
if errorlevel 1 set PATH=%SystemDrive%cygwinin;%PATH%
cmd /c

nmake /nologo -f JavaScriptCoreGenerated.make clean
nmake -f JavaScriptCoreGenerated.make"
  CleanCommandLine="%SystemDrive%cygwininwhich.exe bash
if errorlevel 1 set PATH=%SystemDrive%cygwinin;%PATH%
cmd /c

nmake /nologo -f JavaScriptCoreGenerated.make clean"
 />
</VisualStudioPropertySheet>
 

其中编译这个工程使用的命令行(BuildCommandLine)为:

%SystemDrive%cygwininwhich.exe bash
if errorlevel 1 set PATH=%SystemDrive%cygwinin;%PATH%
cmd /c

nmake /nologo -f JavaScriptCoreGenerated.make

从上面可以看到,首先执行which命令在环境变量PATH里面查找bash的位置,如果查找不成功,则将cygwin下面的bin目录加到环境变量里面PATH。接着调用cmd /c, 表示当执行完相应的命令(在命令提示符中)后自动退出命令提示符,这个接的命令为空,应该只是用于刷新命令行环境。最后用nmake去编译JavaScriptCoreGenerated.make这个文件了,JavaScriptCoreGenerated.make文件内容如下:

all:
    touch "$(WEBKITOUTPUTDIR)uildfailed"
    bash build-generated-files.sh "$(WEBKITOUTPUTDIR)" "$(WEBKITLIBRARIESDIR)"
    -bash -c "python react-to-vsprops-changes.py"
    -mkdir 2>NUL "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIAPICast.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJavaScript.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSBase.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSContextRef.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSContextRefPrivate.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSObjectRef.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSObjectRefPrivate.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSStringRef.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSStringRefCF.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSStringRefBSTR.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSValueRef.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJavaScriptCore.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSRetainPtr.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSWeakObjectMapRefInternal.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSWeakObjectMapRefPrivate.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIJSRetainPtr.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIOpaqueJSString.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    xcopy /y /d "....APIWebKitAvailability.h" "$(WEBKITOUTPUTDIR)includeJavaScriptCore"
    -mkdir 2>NUL "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"

    xcopy /y /d "....wtf*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....wtf ext*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....wtfunicode*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....wtfunicodeicu*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....parser*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....untime*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....ytecode*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....interpreter*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....assembler*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....jit*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....debugger*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....profiler*.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....create_hash_table" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....pcrepcre.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....wtf extAtomicString.cpp" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....wtf extStringBuilder.cpp" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....wtf extStringImpl.cpp" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    xcopy /y /d "....wtf extWTFString.cpp" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"

    -mkdir 2>NUL "$(WEBKITOUTPUTDIR)inJavaScriptCore.resources"
    xcopy /y /d "..JavaScriptCore.resources*" "$(WEBKITOUTPUTDIR)inJavaScriptCore.resources"
    -del "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCorestdbool.h" "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCorestdint.h"
    -del "$(WEBKITOUTPUTDIR)uildfailed"

clean:
    -del "$(WEBKITOUTPUTDIR)uildfailed"
    -del /s /q "$(WEBKITOUTPUTDIR)includeJavaScriptCoreJavaScriptCore"
    -del /s /q "$(WEBKITOUTPUTDIR)objJavaScriptCoreDerivedSources"
    -del /s /q "$(WEBKITOUTPUTDIR)includeprivateJavaScriptCore"
    -del /s /q "$(WEBKITOUTPUTDIR)inJavaScriptCore.resources"

 

all规

补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,