|
Packit Service |
c5cf8c |
#! /usr/bin/env perl
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# A simple check of the make output when developing
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
$debug = 0;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
while (<>) {
|
|
Packit Service |
c5cf8c |
if (/cd (\w*) \&\& make/) {
|
|
Packit Service |
c5cf8c |
print "Dir $1\n";
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (/^gcc /) {
|
|
Packit Service |
c5cf8c |
s/[\r\n]*$//;
|
|
Packit Service |
c5cf8c |
while (/\\$/) {
|
|
Packit Service |
c5cf8c |
# Read continuation lines
|
|
Packit Service |
c5cf8c |
s/\\$//;
|
|
Packit Service |
c5cf8c |
$_ .= <>;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
RESTART:$gccline = $_;
|
|
Packit Service |
c5cf8c |
$filename = $gccline;
|
|
Packit Service |
c5cf8c |
$filename =~ s/.*\s(\w*\.c)/\1/;
|
|
Packit Service |
c5cf8c |
if ($filename eq $gccline) {
|
|
Packit Service |
c5cf8c |
# No file name was found, so reset to null
|
|
Packit Service |
c5cf8c |
$filename = "";
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
while (<>) {
|
|
Packit Service |
c5cf8c |
s/[\r\n]*$//;
|
|
Packit Service |
c5cf8c |
while (/\\$/) {
|
|
Packit Service |
c5cf8c |
$nextline = <>;
|
|
Packit Service |
c5cf8c |
$nextline =~ s/[\r\n]*//;
|
|
Packit Service |
c5cf8c |
$_ .= $nextline;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
print "Looking for |$filename|\n" if $debug;
|
|
Packit Service |
c5cf8c |
if ($filename ne "" && /^$filename/) {
|
|
Packit Service |
c5cf8c |
print "$_\n";
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
else {
|
|
Packit Service |
c5cf8c |
last;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (/^gcc/) {
|
|
Packit Service |
c5cf8c |
goto RESTART;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|