Makefile - Handle .d files correctly

This commit is contained in:
madmaurice 2023-09-05 12:51:24 +02:00
parent 9ca6c84043
commit 720a9b4609

View file

@ -1,10 +1,17 @@
.DEFAULT_GOAL: all
include Makeconf include Makeconf
# Auto tracking of headers # Auto tracking of headers
CXX_FLAGS += -MMD 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 $@ $^ cmd = $(VERBOSE)g++ $(CXX_FLAGS) -o $@ $^
msg = $(or $(verb_$@),finalize) $@ msg = $(or $(verb_$@),finalize) $@