The g++ -MM $(SOURCES) creates dependency list (without system deps) for
all the sources in a format suitable for Makefile.
I don't like using g++ just after making use of clang++ explicit as I
don't know whether both of those are usually present on PCs.
The solution would probably be to provide the g++ incompatible flag
conditionally when c++ == clang++.
CC := clang++
CFLAGS = -std=c++98 -Wall -Wextra -Werror -Wpedantic
+DEP_GEN = g++ -MM
+
ifneq ("$(wildcard .debug)","")
CFLAGS += -g -fno-limit-debug-info
endif
re : fclean
$(MAKE) all
+
+depend: .depend
+
+.depend: $(SOURCES)
+ rm -f $@
+ $(DEP_GEN) $^ > $@
+
+include .depend