1
/***************************************************************************
2
* Copyright 1999-2001 Bernd Gehrmann <bernd@kdevelop.org> *
3
* Copyright 2007 Dukju Ahn <dukjuahn@gmail.com> *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
***************************************************************************/
12
#include "outputfilters.h"
16
// @todo could get these from emacs compile.el
17
QList<ErrorFormat> ErrorFormat::errorFormats = QList<ErrorFormat>()
18
// GCC - another case, eg. for #include "pixmap.xpm" which does not exists
19
<< ErrorFormat( "([^: \t]+):([0-9]+):(?:[0-9]+):([^0-9]+)", 1, 2, 3 )
21
<< ErrorFormat( "([^: \t]+):([0-9]+):([^0-9]+)", 1, 2, 3 )
23
<< ErrorFormat( "([^: \\t]+)\\(([0-9]+)\\):([^0-9]+)", 1, 2, 3, "intel" )
25
<< ErrorFormat( "(libtool):( link):( warning): ", 0, 0, 0 )
27
<< ErrorFormat( "undefined reference", 0, 0, 0 )
28
<< ErrorFormat( "undefined symbol", 0, 0, 0 )
29
<< ErrorFormat( "ld: cannot find", 0, 0, 0 )
30
<< ErrorFormat( "No such file", 0, 0, 0 )
32
<< ErrorFormat( "No rule to make target", 0, 0, 0 )
34
<< ErrorFormat( "\"(.*)\", line ([0-9]+):(.*)", 1, 2, 3 )
36
<< ErrorFormat( "[a-zA-Z]+:([^: \t]+):([0-9]+):[0-9]+:[a-zA-Z]:(.*)", 1, 2, 3 )
38
<< ErrorFormat( "fortcom: Error: (.*), line ([0-9]+):(.*)", 1, 2, 3, "intel" )
40
<< ErrorFormat( "PGF9(.*)-(.*)-(.*)-(.*) \\((.*): ([0-9]+)\\)", 5, 6, 4, "pgi" )
42
<< ErrorFormat( "PGF9(.*)-(.*)-(.*)-Symbol, (.*) \\((.*)\\)", 5, 5, 4, "pgi" );
44
QList<ActionFormat> ActionFormat::actionFormats = QList<ActionFormat>()
45
// << ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*`[^`]*`(?:[^/\\s;]*/)*([^/\\s;]+)");
46
// << ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:[^/;]*/)*([^/\\s;]+)");
47
// << ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*(?:[^/]*/)*([^/\\s;]*)");
48
<< ActionFormat( i18n("compiling"), 1, 2, "(?:^|[^=])\\b(gcc|CC|cc|distcc|c\\+\\+|"
49
"g\\+\\+|icc|icpc)\\s+.*-c.*[/ '\\\\]+(\\w+\\.(?:cpp|CPP|c|C|cxx|CXX|cs|"
50
"java|hpf|f|F|f90|F90|f95|F95))")
52
<< ActionFormat( i18n("generating"), 1, 2, "/(moc|uic)\\b.*\\s-o\\s([^\\s;]+)")
54
<< ActionFormat( i18nc("Linking object files into a library or executable", "linking"),
55
"libtool", "/bin/sh\\s.*libtool.*--mode=link\\s.*\\s-o\\s([^\\s;]+)", 1 )
57
<< ActionFormat( i18n("compiling"), 1, 1, "^compiling (.*)" )
58
<< ActionFormat( i18n("generating"), 1, 2, "^generating (.*)" )
59
<< ActionFormat( i18nc("Linking object files into a library or executable",
60
"linking"), 1, 2, "(gcc|cc|c\\+\\+|g\\+\\+|icc|icpc)\\S* (?:\\S* )*-o ([^\\s;]+)")
61
<< ActionFormat( i18nc("Linking object files into a library or executable",
62
"linking"), 1, 2, "^linking (.*)" )
64
<< ActionFormat( i18n("built"), -1, 1, "\\[.+%\\] Built target (.*)" )
65
<< ActionFormat( i18n("compiling"), -1, 1, "\\[.+%\\] Building .* object (.*)" )
66
<< ActionFormat( i18n("generating"), -1, 1, "\\[.+%\\] Generating (.*)" )
67
<< ActionFormat( i18nc("Linking object files into a library or executable",
68
"linking"), -1, 1, "^Linking (.*)" )
69
<< ActionFormat( i18n("installing"), -1, 1, "-- Installing (.*)" )
71
<< ActionFormat( i18n("creating"), "", "/(?:bin/sh\\s.*mkinstalldirs).*\\s([^\\s;]+)",
73
<< ActionFormat( i18n("installing"), "", "/(?:usr/bin/install|bin/sh\\s.*mkinstalldirs"
74
"|bin/sh\\s.*libtool.*--mode=install).*\\s([^\\s;]+)", 1 )
76
<< ActionFormat( i18n("generating"), "dcopidl", "dcopidl .* > ([^\\s;]+)", 1 )
77
<< ActionFormat( i18n("compiling"), "dcopidl2cpp", "dcopidl2cpp (?:\\S* )*([^\\s;]+)",
79
// match against Entering directory to update current build dir
80
<< ActionFormat( "cd", "", "make[^:]*: Entering directory `([^']+)'", 1);
82
ErrorFormat::ErrorFormat( const QString& regExp, int file, int line, int text )
83
: expression( regExp )
89
ErrorFormat::ErrorFormat( const QString& regExp, int file, int line, int text, const QString& comp )
90
: expression( regExp )
97
ActionFormat::ActionFormat( const QString& _action, const QString& _tool, const QString& regExp, int file )
99
, expression( regExp )
106
ActionFormat::ActionFormat( const QString& _action, int tool, int file, const QString& regExp)
108
, expression( regExp )