Use (better) makefiles and fix compiler warnings