missing project/build files
[client-tools.git] / src / build / shared / make_workspace.pl
blob68cb92c4192dfb53a7bafdf62e2b4ca92201379f
1 #!/usr/bin/perl
3 use File::Find;
5 # Process command line arguments.
6 while ($ARGV[0] =~ /^-/)
8 $_ = shift;
10 if ($_ eq "--debug")
12 $debug = 1;
14 else
16 die "unknown command line option";
20 # Determine directory to run this on.
21 @findDirs = @ARGV ? @ARGV : ('.');
23 # Scan for appropriate files.
24 find(\&FindHandler, @findDirs);
26 # Done.
27 exit(0);
29 # ===================================================================
31 sub FindHandler
33 if (-d $_)
35 # Examining a directory entry.
37 # Prune the directory if it's one I want to ignore. This
38 # stops the program from descending any further down this directory.
39 if (m/^(compile|external|Debug|Optimized|Production|Release)$/i)
41 # Prune it.
42 $File::Find::prune = 1;
43 print STDERR "[Pruned Directory Entry: $File::Find::name]\n" if ($debug);
46 elsif (-f $_)
48 # Handle files that should go in the workspace file.
49 if (m/^.*(c|cpp|def|h|hpp|java|lnt|pl|pm|py|script(?:lib)?|sql|tab|txt)$/)
51 print "$_:$File::Find::dir/\n";
56 # ===================================================================