diff --git a/colormake.pl b/colormake.pl index 72b20f2..2608e7a 100755 --- a/colormake.pl +++ b/colormake.pl @@ -67,6 +67,9 @@ $cols = shift @ARGV || 0; $cols -= 19; +$file = '[^\/?*:;{}\\\]+'; +$code_file = "$file\.(c|cpp|cc|hpp)"; + $in = 'unknown'; $| = 1; while (<>) @@ -88,7 +91,13 @@ { $in = 'make'; } - elsif ($thisline =~ s/^(\s*(libtool:\s*)?((compile|link):\s*)?(([[:ascii:]]+-)?g?(cc|\+\+)|(g|c)\+\+).*)$/$col_gcc$1$col_norm/) + elsif ($thisline =~ s/^( + \s*(libtool:\s*)? + ((compile|link):\s*)? + (([[:ascii:]]+-)?g?(cc|\+\+)|(g|c)\+\+).* + |$code_file + )$ + /$col_gcc$1$col_norm/x) { $in = 'gcc'; }