diff --git a/Makefile b/Makefile index f7ed379..9ac90fc 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,17 @@ +.DEFAULT_GOAL: all + include Makeconf # Auto tracking of headers CXX_FLAGS += -MMD -depfiles := $(wildcard *.d **/*.d) -clean-objs := $(TARGETS) $(foreach t,$(TARGETS),$(modules_$(t))) $(depfiles) +all-modules := $(foreach t,$(TARGETS),$(modules_$(t))) + +depfiles := $(patsubst %.o,%.d,$(filter %.o,$(all-modules))) + +-include $(depfiles) + +clean-objs := $(TARGETS) $(all-modules) $(depfiles) cmd = $(VERBOSE)g++ $(CXX_FLAGS) -o $@ $^ msg = $(or $(verb_$@),finalize) $@