generate-derived-sources-manx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/usr/bin/perl -w
  2. use File::Path qw(mkpath);
  3. use FindBin;
  4. use Getopt::Long qw(:config pass_through);
  5. use lib $FindBin::Bin;
  6. use strict;
  7. use webkitdirs;
  8. chdirWebKit();
  9. my $os;
  10. my $parts;
  11. my $keep;
  12. my $derivedSourcesSuffix;
  13. my %options = (
  14. 'os=s' => \$os,
  15. 'parts|p=s' => \$parts,
  16. 'keep|k' => \$keep,
  17. );
  18. GetOptions(%options);
  19. if ($os eq 'orbis') {
  20. $derivedSourcesSuffix = 'orbis';
  21. } elsif ($os eq 'psp2') {
  22. $derivedSourcesSuffix = 'psp2';
  23. } else {
  24. die "Unknown OS: ${os}";
  25. }
  26. if (defined $parts) {
  27. # disable nuking the DerivedSources_* dir when parts are specified
  28. $keep = 1;
  29. } else {
  30. $parts = 'JavaScriptCore,WebCore,WebKit2,WebKitTestRunner';
  31. }
  32. my @parts = split(/,/, $parts);
  33. my $derivedSourcesDir = File::Spec->catdir(getcwd(), "/DerivedSources_${derivedSourcesSuffix}");
  34. if (not defined $keep) {
  35. system('rm', '-rf', $derivedSourcesDir);
  36. }
  37. foreach (@parts) {
  38. chdirWebKit();
  39. if ($_ eq "WebKitTestRunner") {
  40. # FIXME use same generate-derived-sources-manx.sh script as other parts
  41. my $webKitTestRunner = File::Spec->catdir($derivedSourcesDir, "WebKitTestRunner");
  42. mkpath $webKitTestRunner;
  43. chdir $webKitTestRunner or die;
  44. system('make', '-f', '../../Tools/WebKitTestRunner/DerivedSources.make', 'WebKitTestRunner=../../Tools/WebKitTestRunner', 'WebCoreScripts=../../Source/WebCore/bindings/scripts');
  45. } else {
  46. chdir "Source/$_/gyp" or die;
  47. system('bash', 'generate-derived-sources-manx.sh', $derivedSourcesDir, $os);
  48. }
  49. }
  50. chdirWebKit();
  51. chdir 'Source/WebKit/scripts' or die;
  52. system('perl', 'generate-webkitversion.pl', '--config', '../mac/Configurations/Version.xcconfig', '--outputDir', $derivedSourcesDir);