A particularly tricky task with GNU make is automatically adding target dependencies on header files and handling updates to them (gcc's -M and -MMD switches). It would be great if the article explained those best practices, too.
Edit: https://nostarch.com/gnumake (via https://blog.jgc.org/2015/04/the-gnu-make-book-probably-more...)
I use the patterns in @jgrahamc's article "Escaping: A Walk on the Wild Side" pretty often. Especially the \n definition, which works great to put on the end of a $(foreach) loop inside of a recipe.
@jgrahamc: Thanks for all you've written on Make over the years.
$(BIN)/%.cpp.o: %.cpp
$(CXX) -c $(CXXFLAGS) "$<" -o "$@"
@$(CXX) -c $(CXXFLAGS) "$<" -o "$@.deps" -MP -MM -MT "$@"
-include $(shell test -d $(BIN) && find $(BIN) -name "*.deps") CFLAGS=-MD -MP
prog: <list of .o files>
$(CC) -o $@ $^
-include *.d