@kloudkl had added the `+$(OBJ_BUILD_DIR)/%.cuo:` rule (presumably due to the renaming of syncedmem.cpp->syncedmem.cu -- we had no rule for building `*.cu` files in the top-level `src/caffe` directory), but I moved it down in the list because older versions of `make` (including the one I use, the default Ubuntu installation) will match the *first* rule matching instead of the most specific one, so this rule matched `*.cu` files in subdirs also, which I fixed by moving it after all other `*.cu` rules.

The rest of the changes were basically style changes and adding a dependency on the header files `$(HXX_SRCS)` where I happened to notice there wasn't one before (in one case changing from `$(PROTO_GEN_HEADER)`, which is a subset of `$(HXX_SRCS)`)   Sorry for mixing these changes into an unrelated PR...I can remove them from history if desired.