blob: 14aeb1f23d0f48f2cef9264847fbf86a80b54799 [file] [log] [blame]
#!/usr/bin/perl -w
# Simplified build script for Web Kit Open Source Project.
use strict;
use Getopt::Long;
my $debug = 0;
GetOptions("debug!" => \$debug);
my $style = $debug ? "Development" : "Deployment";
# Check that we're in the right directory.
if (! -d "WebKitTools") {
if (-d "../WebKitTools") {
chdir ".." or die;
}
if (! -d "WebKitTools") {
die "No WebKitTools directory found. Please run this script from the directory containing WebKitTools.\n";
}
}
# Check that an Xcode product directory is set.
open PRODUCT, "defaults read com.apple.Xcode PBXProductDirectory 2> /dev/null |" or die;
my $productDir = <PRODUCT>;
close PRODUCT;
if (!$productDir) {
die "No product directory set. Please set the 'Place Build Products' preference to 'Customized location' in XCode Building Preferences.\n";
}
# Check that all the project directories are there.
my @projects = ("JavaScriptCore", "WebCore", "WebKit");
my @otherDirs = ("WebKitLibraries");
for my $dir (@projects, @otherDirs) {
if (! -d $dir) {
die "No $dir directory found. Can't build\n";
}
}
# Build, and abort if the build fails.
for my $dir (@projects) {
chdir $dir or die;
my $result = system "xcodebuild", "-buildstyle", $style;
exit $result if $result;
chdir ".." or die;
}
# Write out congratulations message.
print "\n";
print "===========================================================\n";
print " Web Kit is now built. To run Safari with this newly-built\n";
print " code, use the run-safari script.\n";
print "===========================================================\n";