BVLC/caffe — pull request #277 by jeffdonahue (2014-03-30 15:29:54+00:00)
Title: Makefile improvements

A bunch of changes (any of which are open for discussion...I'm especially unsure if (3) is worthwhile to others, but it was useful for me) to the Makefile including:

1) The most significant change (responsible for probably 75+% of the diff): corrected targets/dependencies. e.g. you can now do `make ./build/tools/train_net.bin` to generate only that binary and any dependencies from a totally clean directory, and then rerunning it will give you `make: build/tools/train_net.bin' is up to date. ` unless a source file it depends on (e.g. `tools/train_net.cpp`) has been modified -- similarly for `make all` , `make test`, etc. Please let me know if anyone thinks I may have missed anything; I've never tried to write a 'real' Makefile before so I could easily have overlooked or done things in a very weird/wrong way...

2) TEST_GPUID moves to Makefile.config.example; doesn't seem like we want changes to it tracked by git.

3) A `superclean` target that deletes all files ending with extensions that we build (`.so .a .o .bin .testbin .pb.cc .pb.h _pb2.py .cuo`), which I wrote because whenever I build an old Caffe version I end up with tons of these files littered throughout my directory that `make clean` won't get rid of because they aren't in `build/` or one of the other few known locations. (Also added `supercleanlist` target to list files that `make superclean` would delete, in case you want to be careful.)

4) All core generated files now go somewhere in `build/`, including `libcaffe.{a,so}` (under `build/lib/`) and proto-generated `.pb.{cc,h}` files. The only generated files that don't go in `build/` are the Python and MATLAB wrappers (including proto-generated Python), which stay where they are currently.

TODO: test MATLAB build.