8 if (scalar @ARGV < 2) {
9 die "Usage: $0 <dir to check> <file to log> <optional number of jobs>\n";
12 if (!-e
"./ReadMe.cross-compile") {
13 die "ERROR: $0 must be called from Haiku top directory!\n";
17 my $dirToCheck = shift @ARGV;
18 my $fileToLog = shift @ARGV;
26 print "Scanning headers...\n";
27 find
({ wanted
=> \
&process
, no_chdir
=> 1},
28 ("headers/posix", "headers/libs", "headers/os", "headers/private"));
30 foreach my $dir (sort keys %headers) {
31 $headersDirs .= "-I $dir ";
34 print "Running cppcheck tool...\n";
35 $cppcheck = "cppcheck -j $jobs --force --auto-dealloc 3rdparty/cppcheck/haiku.lst --enable=exceptRealloc,possibleError $headersDirs $dirToCheck 2> $fileToLog";
41 if (substr($_, -4, 4) eq '.svn') {
42 $File::Find
::prune
= 1;
44 return if $File::Find
::dir
eq $_; # skip toplevel folders
45 my $name = (fileparse
($_))[0];
47 push @
{$headers{$File::Find
::name
}->{subdirs
}}, $name;