I need a Makefile that will compile everything in the current directory and recursively down the tree, and preferably use the compiler’s dependency thing (-M, etc.) so that whenever I type “make”, as little as possible is recompiled.
Also, why is this not page 1 of the Makefile documentation?
While I would suggest using tools like cmake or alike, I understand that sometimes it is easier or better to use a plain old Makefile.
Here’s a Makefile I’ve used on some projects, it creates dependency-files using gcc: