执行编译qtwebkit命令:
./Tools/Scripts/build-webkit --qt --no-video --debug./Tools/Scripts/build-webkit 590
588 } elsif (isQt()) {
589 #FIXME: $dir should probably be $project.
590 $result = buildQMakeQtProject($dir, $clean, @options);
Tools/Scripts/webkitdirs.pm 1788
1788 sub buildQMakeQtProject($$@)
1789 {
1790 my ($project, $clean, @buildArgs) = @_;
1791
1792 return buildQMakeProject("", $clean, @buildArgs);
1793 } 一、Source/DerivedSources.pro
Tools/Scripts/webkitdirs.pm 1660
1659 print "Calling '$qmakebin @dsQmakeArgs' in " . $dir . "\n\n";
#Calling 'qmake -r OUTPUT_DIR=/root/QtWebKit-2.2.0/WebKitBuild/Debug -r /root/QtWebKit-2.2.0/Source/DerivedSources.pro -o Makefile.DerivedSources' in /root/QtWebKit-2.2.0/WebKitBuild/Debug
1660 my $result = system "$qmakebin @dsQmakeArgs";
1661 if ($result ne 0) {
1662 die "Failed while running $qmakebin to generate derived sources!\n";
1663 } Source/DerivedSources.pro 的内容:
linux-pl6d:~/QtWebKit-2.2.0 # cat Source/DerivedSources.pro
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += \
JavaScriptCore/DerivedSources.pro \
WebCore/DerivedSources.pro \
WebKit/qt/Api/DerivedSources.pro
webkit2: SUBDIRS += WebKit2/DerivedSources.pro
for(subpro, SUBDIRS) {
subdir = $${dirname(subpro)}
subtarget = $$replace(subpro, [^a-zA-Z0-9_], -)
eval($${subtarget}.makefile = "Makefile.DerivedSources")
eval(generated_files-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f Makefile.DerivedSources generated_files))
QMAKE_EXTRA_TARGETS += generated_files-$${subtarget}
generated_files.depends += generated_files-$${subtarget}
}
QMAKE_EXTRA_TARGETS += generated_files 执行Source/DerivedSources.pro 之后生成三个目录(
JavaScriptCore WebCore WebKit/qt/Api)下的makefile文件(例如:
/usr/bin/qmake OUTPUT_DIR=/root/QtWebKit-2.2.0/WebKitBuild/Debug -o Makefile.DerivedSources ../Source/JavaScriptCore/DerivedSources.pro)
二、执行三个目录下的makefile
1685 for my $subdir (@subdirs) {
1686 my $dsMakefile = "Makefile.DerivedSources";
1687 print "Calling '$make $makeargs -C $subdir -f $dsMakefile generated_files' in " . $dir . "/$subdir\n\n";
#Calling 'make -C JavaScriptCore -f Makefile.DerivedSources generated_files' in /root/QtWebKit-2.2.0/WebKitBuild/Debug/JavaScriptCore
1688 if ($make eq "nmake") {
1689 my $subdirWindows = $subdir;
1690 $subdirWindows =~ s:/:\\:g;
1691 $result = system "pushd $subdirWindows && $make $makeargs -f $dsMakefile generated_files && popd";
1692 } else {
1693 $result = system "$make $makeargs -C $subdir -f $dsMakefile generated_files";
1694 }
1695 if ($result ne 0) {
1696 die "Failed to generate ${subdir}'s derived sources!\n";
1697 }
1698 } 1、JavaScriptCore:
dir="JavaScriptCore";
qmake OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug -o $dir/Makefile.DerivedSources Source/$dir/DerivedSources.pro;
make -C $dir -f Makefile.DerivedSources generated_files;在$dir/
generated目录下生成
hashtable头文件:
DatePrototype.lut.h、
JSONObject.lut.h……
2、
WebCoredir="";qmake;
make;同上
执行Source/
WebCore/bindings/scripts/generate-bindings.pl脚本,输入参数为Source/WebCore/目录下的各种idl文件
83 $codeGen->ProcessDocument($document, $defines); Source/WebCore/bindings/scripts/CodeGenerator.pm
148 $codeGenerator->GenerateInterface($class, $defines); Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
生成WebCore/generated目录下的各种JS头文件、cpp文件,例如:JSComment.h JSComment.cpp等等
117 # Open files for writing
118 my $headerFileName = "$outputDir/JS$name.h";
119 my $implFileName = "$outputDir/JS$name.cpp";
120 my $depsFileName = "$outputDir/JS$name.dep";
121
122 # Remove old dependency file.
123 unlink($depsFileName);
124
125 open($IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
126 open($HEADER, ">$headerFileName") || die "Couldn't open file $headerFileName";
127 if (@depsContent) {
128 open($DEPS, ">$depsFileName") || die "Couldn't open file $depsFileName";
129 }
84 sub finish
85 {
86 my $object = shift;
87
88 # Commit changes!
89 $object->WriteData();
90 } 3、WebKit/qt/Api
dir="";qmake;make;同上
生成include/QtWebKit/目录下文件:qwebframe.h QWebHitTestResult
四、Source/WebKit.pro 生成makefile
1725 $result = system "$qmakebin @buildArgs"; qmake -r OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Source/WebKit.pro根据
Source/WebKit/qt/
declarative/、Source/WebKit/qt/tests/目录下的所有pro文件生成
WebKitBuild/Debug/WebKit/qt目录下的Makefile文件
五、
Tools/Tools.pro 生成Makefileqmake -r OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Tools/Tools.pro -o Makefile.Tools六、
Source/WebKit/qt/examples/examples.proqmake -r OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Source/WebKit/qt/examples/examples.pro
七、执行make
Tools/Scripts/webkitdirs.pm
1780 $result = system "$make $makeargs"; 如下目录下执行
Source/JavaScriptCore Source/JavaScriptGlue Source/ThirdParty/ANGLE Source/WebCore Source/WebKit Source/WebKit2 Tools