I am trying to install CUDA on my Mac Pro (15-inch, Mid 2009 with GPU GeForce 9400M).
I have installed from https://developer.nvidia.com/cuda-downloads the toolkit.
nvcc
The CUDA 7 release cycle removed support for compute capability 1.x devices on all platforms. This includes your Geforce 9400M.
The last version with support of those devices was CUDA 6.5. You will need to work out what XCode version will work with that CUDA toolkit and your OS version and install that instead.
[This answer assembled from comments as a community wiki entry to get this question off the unanswered queue for the CUDA tag].