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.

31 lines
929 B

  1. package Dispatch;
  2. $total=((@_)?\@_:\@ARGV)->[0];
  3. $total=16 if(!defined $total);
  4. $chars=int(1+log($total)/log(10));
  5. open(F, ">..\\MakeFile.mak");
  6. printf F ("all : process\%0${chars}d\%0${chars}d\n", 1, 1);
  7. for ($i=1; $i<=$total; $i++) {
  8. for ($l=$j=1; $j <= $i; $j++) {
  9. printf F ("process\%0${chars}d\%0${chars}d :\n\t\$(MAKE) /NOLOGO /F makefile ", $i, $j);
  10. for ($k=1; $k <= $total / $i + ($j <= ($total % $i)); $k++) {
  11. printf F ("process\%0${chars}d\%0${chars}d ", $total, $l++);
  12. }
  13. print F "\n";
  14. }
  15. }
  16. # for ($i=1; $i<=$total; $i++) {
  17. # printf F ("process\%0${chars}d\%0${chars}d : \n\t\$(MAKE) /NOLOGO /F makefile process\%0${chars}d\%0${chars}d\n\n", $total, $i, $total, $i);
  18. # }
  19. close(F);
  20. # ## For Test
  21. # open(F, ">MakeFile.Mak");
  22. # for ($i=1; $i<=$total; $i++) {
  23. # printf F ("process\%0${chars}d\%0${chars}d : \n\techo This is process\%0${chars}d\%0${chars}d\n\n", $total, $i, $total, $i);
  24. # }
  25. # close(F);