BVLC/caffe — pull request #649 by jeffdonahue (2014-07-09 01:10:01+00:00)
Title: "make warn" to print compilation warnings; "make lint" runs incrementally

This PR addresses #588, allowing you to do `make warn` to see all the compiler warnings printed during compilation of C files (really anything that your compiler sent to STDERR, which with gcc is nothing unless you have compiler warnings). It's implemented by sending all STDERR output to another file ending with `warnings.txt` (still printing these warnings immediately after compilation even if you never run `make warn`) and then concatenating all these warning files into a single summary file afterwards. If your code successfully compiles without any warnings (i.e. the warning summary file is empty) you should see make happily print `make: Nothing to be done 'warn'` when `make warn` is run again; otherwise the warnings will be printed every time `make warn` is run (but without recompiling).

In the second commit, I made lint behave in a similar way, producing a per-file lint report and then concatenating the outputs into a summary lint report. This way lint runs very fast if you run "make lint", change just one source file, and then run "make lint" again -- this is because it's only invoked for the changed file rather than again for the entire codebase.