From e785f234f83c73a5c2e93ef64e1d69fe8a2dea8a Mon Sep 17 00:00:00 2001 From: heck Date: Fri, 4 Dec 2020 23:20:11 +0100 Subject: [PATCH] Use compiler to generate .d files instead of using sed. --- Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3c72e78..6eac3c6 100644 --- a/Makefile +++ b/Makefile @@ -13,15 +13,10 @@ SOURCE=$(wildcard *.cc) HEADERS=$(wildcard *.hh *.hxx) OBJECTS=$(subst .cc,.o,$(SOURCE)) DEPENDS=$(subst .cc,.d,$(SOURCE)) +CXXFLAGS+= -MMD -MP all: $(TARGET) -%.d: %.cc - @set -e; rm -f $@; \ - $(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - ifneq ($(MAKECMDGOALS),clean) -include $(DEPENDS) endif