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.

34 lines
840 B

  1. # FileName: gensbrlists.pl
  2. #
  3. #
  4. # Usage = gensbrlists.pl <searchroot> <$O>
  5. #
  6. # Function: Starting from searchroot, collects info on all sbr files
  7. # * Only include those files under $O
  8. # * generates files into $O
  9. # * creates sbrlist.inc to be !included into nmake file with macro for SBRLIST
  10. $PGM = 'GENSBRLISTS: ';
  11. $CurDir = <CWD>;
  12. $Usage = $PGM . "Usage: gensbrlists.pl <searchroot> <\$O>\n";
  13. if (@ARGV != 2) { die $Usage; }
  14. ($BaseDir, $O) = @ARGV;
  15. $OutFile=">$O\\sbrlist.inc";
  16. open OUTFILE, $OutFile or die "$PGM Could not open $OutFile";
  17. print OUTFILE "SBRLIST = \\\n";
  18. $DirCommand="dir /b/s $BaseDir\\*.sbr|";
  19. open DIRS, $DirCommand or die "$PGM Command failed: '$DirCommand' executed in $CurDir\n";
  20. $O =~ s/\\/\\\\/g;
  21. for (<DIRS>) {
  22. chomp;
  23. print OUTFILE "$_ \\\n" if (/$O/i && -s);
  24. }
  25. close DIRS;
  26. close OUTFILE;