[PATCH] Use -MT options to build dependency files

Mike Hommey mh+jemalloc at glandium.org
Thu Apr 12 08:19:20 PDT 2012


From: Mike Hommey <mh at glandium.org>

---
 Makefile.in |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index b879807..a01e5e9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -105,12 +105,12 @@ build_doc: $(DOCS)
 src/%.o: $(srcroot)src/%.c
 	@mkdir -p $(@D)
 	$(CC) $(CFLAGS) -c $(CPPFLAGS) -o $@ $<
-	@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
+	@$(CC) -MM $(CPPFLAGS) -MT $@ -o $(@:%.o=%.d) $<
 
 src/%.pic.o: $(srcroot)src/%.c
 	@mkdir -p $(@D)
 	$(CC) $(CFLAGS) -fPIC -DPIC -c $(CPPFLAGS) -o $@ $<
-	@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $(basename $@))))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.pic.o \2/g\" > $(@:%.o=%.d)"
+	@$(CC) -MM $(CPPFLAGS) -MT $@ -o $(@:%.o=%.d) $<
 
 %.$(SO) : %.$(SO).$(REV)
 	@mkdir -p $(@D)
-- 
1.7.9.5




More information about the jemalloc-discuss mailing list