How can I analyze make output for compiler warnings?

compiler-warnings, gcc, gcc-warning, makefile

Solution

GCC sends warnings and errors to standard error (file descriptor `2`) while normal output goes to standard output (file descriptor `1`). You could redirect warnings or errors to an extra file and parse the outputs to generate a report.

$ make 1> log 2> error_log

Problem

I'm working on a cross platform C++ application for Windows, Mac OS X and Linux. The development is done on Windows and then compatibility with gcc on Mac OS X and Linux is tested. On windows we use Visual Studio for compilation and under Linux and Mac OS X we use Makefiles. Is there a way to filter the compiler warnings per project/module? Most projects have their own Makefile and then call qmake for sub-projects. Is their a tool or provent method to collect compiler warnings and errors in such a scenario? Ideally I'd like to have html output, with a summary per project and a detail page for the actual errors.

Original source