Sweden-Number/tools/winapi/make_filter

71 lines
1.5 KiB
Plaintext
Raw Normal View History

#! /usr/bin/perl -w
use strict;
BEGIN {
$0 =~ m%^(.*?/?tools)/winapi/make_filter$%;
require "$1/winapi/setup.pm";
}
use config qw($current_dir $wine_dir);
use output qw($output);
use make_filter_options qw($options);
use make_parser;
if($options->progress) {
$output->enable_progress;
} else {
$output->disable_progress;
}
########################################################################
# main
########################################################################
my $command = join(" ", $options->arguments);
open(IN, "($command) 2>&1 |");
while(<IN>) {
chomp;
if(!&make_parser::line($_)) {
next;
}
my $directory = &make_parser::directory();
my $file = &make_parser::file_name();
my $line = &make_parser::file_line();
my $message = &make_parser::message();
if(&make_parser::tool() eq "make") {
if($directory && $directory ne ".") {
$output->progress("$directory: make");
}
} elsif($message) {
if($file && $line) {
if($directory) {
$output->write("$directory/$file:$line: $message\n");
} else {
$output->write("$file:$line: $message\n");
}
} elsif($file) {
if($directory) {
$output->write("$directory/$file: $message\n");
} else {
$output->write("$file: $message\n");
}
} else {
if($directory) {
$output->write("$directory: " . &make_parser::tool() . ": $message\n");
} else {
$output->write(".: " . &make_parser::tool() . ": $message\n");
}
}
}
}
close(IN);
$output->hide_progress();