]> git.sesse.net Git - vlc/blob - extras/make.pl
b23bc19fbe6bcfea6ef3857561515046694c27b2
[vlc] / extras / make.pl
1 #! /usr/bin/perl
2
3 # Attributes
4 $bold = "\033[1m";
5
6 # Colors
7 $white  = "\033[37m";
8 $yellow  = "\033[33m";
9 $magenta  = "\033[35m";
10 $blue  = "\033[34m";
11 $red  = "\033[31m";
12 $reset = "\033[0m";
13
14 # Combinations
15 $info   = $white.$bold;
16 $warn   = $yellow.$bold;
17 $error  = $red.$bold;
18 $file   = $magenta.$bold;
19 $lineno = $blue.$bold;
20
21 while(<STDIN>)
22 {
23      $line = $_;
24      chomp $line;
25      # Skip entering/leaving directories and incomplete lines
26      if( 
27         $line =~ /make\[([0-9]*)\]:.*/ ||
28 #        $line =~ /.*\s\\$/ || 
29         $line =~ /^test\s\-z\s/ || 
30         $line =~ /^Making\sclean\sin\s\./ ||
31         $line =~ /^then\smv/ ||
32         $line =~ /make\s\sall-recursive/ )
33      {}
34      # Info 
35      elsif( 
36           $line =~ s/^.* (lib.*\.so).*/ LINK    : $1/g ||
37           $line =~ s/^.* (lib.*\.o)\s\.\/(.*)/ COMPILE : $2/g ||
38           $line =~ s/^.* (lib.*\.o)\s`.*`(.*);\ \\/ COMPILE : $2/ ||
39           $line =~ s/^[A-z0-9-]*ar\s[A-z0-9]*\s([A-z0-9\-_\/\.]*)\s.*/ ARCHIVE : $1/g ||
40           $line =~ s/^[A-z0-9-]*ranlib\s(.*)/ RANLIB  : $1/g ||
41           $line =~ s/^Making\sall\sin\s(.*)/MAKE     : $1/g ||
42           $line =~ s/^Making\sclean\sin\s(.*)/CLEAN  : $1/g ||
43           $line =~ s/^rm\s\-f\s(.*)/ REMOVE  : $1/g ||
44           $line =~ s/.*\-o\s([^\s]*)\s.*/ BUILD   : $1/g)
45
46      {
47         print $info.$line.$reset."\n";
48      }
49      # Warning
50      elsif (
51           $line =~ s/(.*):([0-9]*):\swarning\:(.*)/WARNING : $file$1: $lineno$2: $warn$3/g  ||
52           $line =~ s/.*is\sdeprecated.*/WARNING : $line/g )
53      {
54         print $warn.$line.$reset."\n";
55      }
56      # Error
57      elsif (
58           $line =~ s/(.*):([0-9]*):\serror\:(.*)/ERROR   : $file$1: $lineno$2: $error$3/g  )
59      {
60         print $error.$line.$reset."\n";
61      }
62      # Print unmatched lines 
63      else
64      {
65         print $line."\n";
66      }
67
68 }