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.

79 lines
2.4 KiB

  1. $COMPILE_CMD = "E:\\BuildTools\\CompileProject.exe";
  2. $DELETE_CMD = "E:\\BuildTools\\DeleteTempFiles.cmd";
  3. while ($_ = $ARGV[0], /^-/)
  4. {
  5. shift;
  6. last if /^--$/;
  7. /^-d(.*)/i && ($targetroot = $1);
  8. /^-f(.*)/i && ($projectinifile = $1);
  9. /^-c(.*)/i && ($config = $1);
  10. /^-p(.*)/i && ($platformfilter = $1);
  11. }
  12. ($targetroot && $projectinifile) || die "Usage: BuildProjects.pl -D<target root dir> -F<project ini file> [-C<configuration to build>] [-P<platform filter>]\n";
  13. open (FILE, $projectinifile) || die "Error opening $projectinifile!\n";
  14. while (<FILE>)
  15. {
  16. /^\[(.*)\]/ && ($projectname = $1) && (push @projectlist, $projectname);
  17. if ( $projectname )
  18. {
  19. /^Directory=(.*)/i && ($directory{$projectname} = $1);
  20. /^Platform=(.*)/i && ($platform{$projectname} = $1);
  21. /^Build=(.*)/i && ($build{$projectname} = $1);
  22. /^ProjectType=(.*)/i && ($projecttype{$projectname} = $1);
  23. /^ProjectFile=(.*)/i && ($projectfile{$projectname} = $1);
  24. /^DeleteDsw=(.*)/i && ($deletedsw{$projectname} = $1);
  25. /^Configurations=(.*)/i && ($projectconfig{$projectname} = $1);
  26. }
  27. }
  28. close FILE;
  29. for ($i = 0; $i <= $#projectlist; $i++)
  30. {
  31. $project = $projectlist[$i];
  32. if ( ! $platformfilter || ($platform{$project} =~ /$platformfilter/i) )
  33. {
  34. if ( $build{$project} =~ /Yes/i )
  35. {
  36. system("echo Building $projecttype{$project} project $projectfile{$project}...");
  37. $targetdir = "$targetroot\\$directory{$project}";
  38. $projectfilepath = "$targetdir\\$projectfile{$project}";
  39. $buildconfig = $projectconfig{$project};
  40. if ( $config ) { $buildconfig = "$buildconfig $config"; }
  41. $outdiroption = "";
  42. if ( $projecttype{$project} =~ /vb/i )
  43. {
  44. if ( $buildconfig =~ /debug/i )
  45. {
  46. $outdir = "$targetroot\\Bin\\IntelDebug";
  47. }
  48. else
  49. {
  50. $outdir = "$targetroot\\Bin\\IntelRelease";
  51. }
  52. if ( ! -d $outdir )
  53. {
  54. system "md \"$outdir\"";
  55. }
  56. $outdiroption = " /OUTDIR:$outdir";
  57. }
  58. # if ( $deletedsw{$project} !~ /no/i )
  59. # {
  60. # system("del /f \"$targetdir\\*.dsw\"");
  61. # }
  62. system("$COMPILE_CMD /TYPE:$projecttype{$project} /CONFIG:$buildconfig /PROJECT:$projectfilepath$outdiroption");
  63. # system("$DELETE_CMD \"$targetdir\"");
  64. }
  65. }
  66. }
  67. exit 0;