2001-07-26 23:42:12 +02:00
|
|
|
#! /usr/bin/perl -w
|
2002-03-10 00:29:33 +01:00
|
|
|
#
|
|
|
|
# Copyright 1999, 2000, 2001 Patrik Stridvall
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
2001-07-26 23:42:12 +02:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
$0 =~ m%^(.*?/?tools)/winapi/make_filter$%;
|
|
|
|
require "$1/winapi/setup.pm";
|
|
|
|
}
|
|
|
|
|
2001-07-29 22:19:14 +02:00
|
|
|
use config qw(
|
|
|
|
&file_absolutize &file_normalize
|
|
|
|
$current_dir $wine_dir
|
|
|
|
);
|
2001-07-26 23:42:12 +02:00
|
|
|
use output qw($output);
|
|
|
|
use make_filter_options qw($options);
|
|
|
|
|
2001-07-29 22:19:14 +02:00
|
|
|
use make_parser qw($directory $tool $file $line $message);
|
2001-07-26 23:42:12 +02:00
|
|
|
|
|
|
|
if($options->progress) {
|
|
|
|
$output->enable_progress;
|
|
|
|
} else {
|
|
|
|
$output->disable_progress;
|
|
|
|
}
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# main
|
|
|
|
########################################################################
|
|
|
|
|
2001-07-29 22:19:14 +02:00
|
|
|
my $command = $options->make . " " . join(" ", $options->arguments);
|
2001-07-26 23:42:12 +02:00
|
|
|
open(IN, "($command) 2>&1 |");
|
|
|
|
|
|
|
|
while(<IN>) {
|
|
|
|
chomp;
|
|
|
|
|
|
|
|
if(!&make_parser::line($_)) {
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
2001-07-29 22:19:14 +02:00
|
|
|
if($message) {
|
2001-07-26 23:42:12 +02:00
|
|
|
if($file && $line) {
|
2001-08-09 23:35:38 +02:00
|
|
|
if($directory && $directory ne "." && $file !~ m%^/%) {
|
2001-07-29 22:19:14 +02:00
|
|
|
$output->write(&file_normalize("$directory/$file") . ":$line: $message\n");
|
2001-07-26 23:42:12 +02:00
|
|
|
} else {
|
|
|
|
$output->write("$file:$line: $message\n");
|
|
|
|
}
|
|
|
|
} elsif($file) {
|
2001-08-09 23:35:38 +02:00
|
|
|
if($directory && $directory ne "." && $file !~ m%^/%) {
|
2001-07-29 22:19:14 +02:00
|
|
|
$output->write(&file_normalize("$directory/$file") . ": $message\n");
|
2001-07-26 23:42:12 +02:00
|
|
|
} else {
|
|
|
|
$output->write("$file: $message\n");
|
|
|
|
}
|
|
|
|
} else {
|
2001-07-29 22:19:14 +02:00
|
|
|
if($directory && $directory ne ".") {
|
|
|
|
$output->write("$directory: $tool: $message\n");
|
|
|
|
} elsif($tool) {
|
|
|
|
$output->write("$tool: $message\n");
|
2001-07-26 23:42:12 +02:00
|
|
|
} else {
|
2001-07-29 22:19:14 +02:00
|
|
|
$output->write("$message\n");
|
2001-07-26 23:42:12 +02:00
|
|
|
}
|
|
|
|
}
|
2001-07-29 22:19:14 +02:00
|
|
|
} elsif($tool eq "make") {
|
|
|
|
if($directory && $directory ne ".") {
|
|
|
|
$output->progress("$directory: make");
|
|
|
|
}
|
2001-07-26 23:42:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
close(IN);
|
|
|
|
|
|
|
|
$output->hide_progress();
|