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.
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!