make.pl 2.21 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /usr/bin/perl

# Attributes
$bold = "\033[1m";

# Colors
$white  = "\033[37m";
$yellow  = "\033[33m";
$magenta  = "\033[35m";
$blue  = "\033[34m";
$red  = "\033[31m";
$reset = "\033[0m";

# Combinations
$info   = $white.$bold;
$warn   = $yellow.$bold;
$error  = $red.$bold;
$file   = $magenta.$bold;
$lineno = $blue.$bold;

while(<STDIN>)
{
     $line = $_;
     chomp $line;
     # Skip entering/leaving directories and incomplete lines
zorglub's avatar
zorglub committed
26
     if(
27
	$line =~ /make\[([0-9]*)\]:.*/ ||
zorglub's avatar
zorglub committed
28
29
#       $line =~ /.*\s\\$/ ||
        $line =~ /^test\s\-z\s/ ||
30
        $line =~ /^Making\sclean\sin\s\./ ||
zorglub's avatar
zorglub committed
31
	$line =~ /then\smv\s-f/ ||
zorglub's avatar
zorglub committed
32
	$line =~ /.*make\s\s.*/ ||
33
        $line =~ /make\s\sall-recursive/ ||
zorglub's avatar
zorglub committed
34
35
        $line =~ /[A-z0-9-]*ar\s[A-z0-9]*\s([A-z0-9\-_\/\.]*)\s.*/ ||
        $line =~ /^[A-z0-9-]*ranlib\s[A-z0-9-_]*plugin(.*)/ ||
zorglub's avatar
zorglub committed
36
37
        $line =~ /^touch.*/ ||
        $line =~ /^srcdir=.*/ ||
zorglub's avatar
zorglub committed
38
        $line =~ /^.* (lib[A-z0-9-_]*plugin.so).*/ ||
zorglub's avatar
zorglub committed
39
	$line =~ /^\sgcc\s-std=.*/ ||
40
    $line =~ /^\sgcc\s-mmacosx.*/ ||
Rafaël Carré's avatar
Rafaël Carré committed
41
42
    $line =~ /^\sg\+\+\s.*/ ||
#    $line =~ /^.*moc.*/ ||
zorglub's avatar
zorglub committed
43
44
45
46
	$line =~ /^.*libtool.*\-o\s(lib.*\.la).*/ ||
        $line =~ /^.*rm\s\-f\s(.*)/ ||
	$line =~ /^rm\s-fr\s(.*)/ ||
	$line =~ /^creating lib.*/ )
47
     {}
zorglub's avatar
zorglub committed
48
49
     # Info
     elsif(
zorglub's avatar
zorglub committed
50
	  $line =~ s/^.*\-shared.*(lib.*\.so).*/ LINK    : $1/g ||
51
          $line =~ s/^.* (lib.*\.so).*/ LINK    : $1/g ||
zorglub's avatar
zorglub committed
52
53
          $line =~ s/^.* (lib.*\.o)\s\.\/(.*)/ COMPILE : $2/g ||
          $line =~ s/^.* (lib.*\.o)\s`.*`(.*);\ \\/ COMPILE : $2/ ||
zorglub's avatar
zorglub committed
54
          $line =~ s/.*\-o\s([^\s]*)\s`.*`([^\s]*);.*/ COMPILE : $2/g ||
55
          $line =~ s/^[A-z0-9-]*ranlib\s(.*)/ RANLIB  : $1/g ||
56
          $line =~ s/^Making\sall\sin\s(.*)/MAKE     : $1/g ||
zorglub's avatar
zorglub committed
57
          $line =~ s/^Making\sclean\sin\s(.*)/CLEAN  : $1/g  )
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
     {
	print $info.$line.$reset."\n";
     }
     # Warning
     elsif (
	  $line =~ s/(.*):([0-9]*):\swarning\:(.*)/WARNING : $file$1: $lineno$2: $warn$3/g  ||
          $line =~ s/.*is\sdeprecated.*/WARNING : $line/g )
     {
	print $warn.$line.$reset."\n";
     }
     # Error
     elsif (
	  $line =~ s/(.*):([0-9]*):\serror\:(.*)/ERROR   : $file$1: $lineno$2: $error$3/g  )
     {
	print $error.$line.$reset."\n";
     }
zorglub's avatar
zorglub committed
74
     # Print unmatched lines
75
76
77
78
79
     else
     {
 	print $line."\n";
     }
}