shewu / h4ck4th0n

Holy Balls: The Game
8 stars 2 forks source link

Generate Makefile dependencies #45

Closed shewu closed 12 years ago

shewu commented 12 years ago

So the entire codebase won't be recompiled if we change something in a header file not used in all implementation files. Here's one write up on how this is done:

http://www.microhowto.info/howto/automatically_generate_makefile_dependencies.html

tjhance commented 12 years ago

See commit 217b2765eb385a81bd0bc8b63e1beab5729095d0

This generates the dependencies as above. Since this is creating a lot more output, I thought it would be a good idea to put all the output into a bin/ directory, to avoid cluttering the source directory. At the top of the Makefile, you can now specify separately a directory for the executables, a directory for the dependencies (the .d files), and a directory for the object files. Right now, the executable directory is set to bin/, and you can make any one with, e.g., make server' ormake bin/server'. Running just `make' still makes everything.

By the way, we have a lot of header file pollution, we should cut down on that so that this new Makefile actually speeds up compilation. See issue #48