Release 1.6-rc2.
[wine/testsucceed.git] / tools / winapi / make_filter
blob45665debcf416a16a26d30e86caa7bc179c0e5e5
1 #! /usr/bin/perl -w
3 # Copyright 1999, 2000, 2001 Patrik Stridvall
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 use strict;
22 BEGIN {
23 $0 =~ m%^(.*?/?tools)/winapi/make_filter$%;
24 require "$1/winapi/setup.pm";
27 use config qw(
28 file_absolutize file_normalize
29 $current_dir $wine_dir
31 use output qw($output);
32 use make_filter_options qw($options);
34 use make_parser qw($directory $tool $file $line $message);
36 if($options->progress) {
37 $output->enable_progress;
38 } else {
39 $output->disable_progress;
42 ########################################################################
43 # main
44 ########################################################################
46 my $command = $options->make . " " . join(" ", $options->arguments);
47 open(IN, "($command) 2>&1 |") || die "Cannot execute command $command: $!";
49 while(<IN>) {
50 chomp;
52 if(!make_parser::line($_)) {
53 next;
56 if($message) {
57 if($file && $line) {
58 if($directory && $directory ne "." && $file !~ m%^/%) {
59 $output->write(file_normalize("$directory/$file") . ":$line: $message\n");
60 } else {
61 $output->write("$file:$line: $message\n");
63 } elsif($file) {
64 if($directory && $directory ne "." && $file !~ m%^/%) {
65 $output->write(file_normalize("$directory/$file") . ": $message\n");
66 } else {
67 $output->write("$file: $message\n");
69 } else {
70 if($directory && $directory ne ".") {
71 $output->write("$directory: $tool: $message\n");
72 } elsif($tool) {
73 $output->write("$tool: $message\n");
74 } else {
75 $output->write("$message\n");
78 } elsif($tool eq "make") {
79 if($directory && $directory ne ".") {
80 $output->progress("$directory: make");
85 close(IN);
87 $output->hide_progress();