Separate the source code into separate files.

See http://stackoverflow.com/a/5128719/2578205
and
https://sites.google.com/site/michaelsafyan/software-engineering/how-to-write-a-makefile