Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

  1. while ($_ = $ARGV[0], /^-/) {
  2. shift;
  3. last if /^--$/;
  4. /^-d(.*)/i && ($targetroot = $1);
  5. /^-f(.*)/i && ($projectfile = $1);
  6. /^-p(.*)/i && ($platformfilter = $1);
  7. }
  8. ($targetroot && $projectfile) ||
  9. die "Usage: RaptorConvert2Alpha.pl -D<target root dir> -F<project ini file> [-P<platform filter>]\n";
  10. open (FILE, $projectfile) || die "Error opening $projectfile!\n";
  11. while (<FILE>) {
  12. /^\[.*\/(.*)\]/ && ($projectname = $1);
  13. if ( $projectname ) {
  14. /^Directory=(.*)/i && ($directory{$projectname} = $1);
  15. /^ProjectFile=(.*)/i && ($projectfile{$projectname} = $1);
  16. /^Platform=(.*)/i && ($platform{$projectname} = $1);
  17. }
  18. }
  19. close FILE;
  20. foreach $project (sort keys %projectfile) {
  21. if ( !$platformfilter || ($platform{$project} =~ /$platformfilter/i) ) {
  22. $targetdir = "$targetroot\\$directory{$project}";
  23. $dspfile = "$targetdir\\$projectfile{$project}";
  24. if ( $dspfile =~ /(.*)\.dsp/i )
  25. {
  26. $alphadsp = "$1_Alpha.dsp";
  27. if ( -f "$alphadsp" ) {
  28. system ("del /f \"$alphadsp\"");
  29. }
  30. open (INFILE, "<$dspfile") || die "Error opening file $dspfile: $!.\n";
  31. open (OUTFILE, ">$alphadsp") || die "Error opening file $alphadsp: $!.\n";
  32. print "Converting $dspfile to ALPHA...\n";
  33. $num = 6;
  34. while (<INFILE>) {
  35. s/(.*TARGTYPE.*0x0)1([0-9][0-9])/$1$num$2/;
  36. s/Win32 \(x86\)/Win32 (ALPHA)/g;
  37. s/(Win32 )(Debug|Release)/$1(ALPHA) $2/g;
  38. s/machine:I386/machine:ALPHA/g;
  39. s/IntelRelease/AlphaRelease/gi;
  40. s/IntelDebug/AlphaDebug/gi;
  41. s/Temp[\\|\/]Release/Temp\\AlphaRelease/gi;
  42. s/Temp[\\|\/]Debug/Temp\\AlphaDebug/gi;
  43. print OUTFILE;
  44. }
  45. close INFILE, OUTFILE;
  46. }
  47. }
  48. }
  49. exit 0;