beware of setting your OBJ_DIR or DEP_DIR to '.' or $(RM) will either succeed or reluctantly fail to delete your working directory. Also make tends to strip off a leading ./ in rules (I guess that's mostly desirable), but it will get in the way if you use CPPFLAGS in a rule and OBJ_DIR as '.' Also you cannot leave those *_DIR simply empty (or you are writing to root (/). And if OBJ_DIR == DEP_DIR, your rule to make the directories will complain. Much of this can be salvaged with a couple of conditionals (or never changing the working Makefile).