News for hackers. Stuff that matters.
Re:A Simple Makefile for Medium-Sized C/C++ Projects by TickleSteve on Friday August 26, 2016 @10:15AM (#12366392)
"But because Make works backward from the object files to the source, we need to compute all the object files we want from our source files".

No.... don't do this.

Make is intended to work the other way around... it finds the source from your targets.

Define your VPATH and let it find them.

This is what loads of people do and is why there are so many Makefiles are packed full of macro-magic!

Re:A Simple Makefile for Medium-Sized C/C++ Projects by Tyr42 on Friday August 26, 2016 @10:24AM (#12366467)
I do agree that VPATH is helpful, but you'd still need to put the Makefile into the build directory in that case, which is distasteful, as it's not a built file.

Also you can't really get around specifying the files or searching, unless you have one c file per executable.

Re:A Simple Makefile for Medium-Sized C/C++ Projects by jimparis on Friday August 26, 2016 @10:41AM (#12366593)
Projects that make blind use of VPATH are a pain. You can't have the same filename in two different directories! It's a hack at best, and using explicit paths (as this Makefile does) is a lot more reliable.
Re:A Simple Makefile for Medium-Sized C/C++ Projects by wyldfire on Friday August 26, 2016 @10:19AM (#12366424)
Totally agree, they should use VPATH. And that way they could've just skipped to the implicit rules version.