I haven't tried it, but I would assume you could put all the code in a single source code file and compile that. Perhaps with a few minor tweaks here and there.
I'm skeptical to the actual advantages of this though. A good modern compiler should be able to do full program optimizations without all the code having to be placed in a single source code file.
If you think you would get any performance advantages by doing this then I suggest you give it a try. Make sure you measure the performance before and after so you can validate if it was actually worth it.
Should you do this I would be very interested in hearing the result of your tests.