[lldb/test] Simplify Makefile rules for .d files

The sed line in the rules was adding the .d file as a target to the
dependency rules -- to ensure the file gets rebuild when the sources
change. The same thing can be achieved more elegantly with some -M
flags.
This commit is contained in:
Pavel Labath 2020-07-15 16:50:34 +02:00
parent e88b6ed748
commit 9decf0405f
1 changed files with 4 additions and 16 deletions

View File

@ -727,28 +727,16 @@ endif
# and the -MM option will list all non-system dependencies.
#----------------------------------------------------------------------
%.d: %.c
@rm -f $@
@$(CC) -M $(CFLAGS) $< > $@.tmp && \
sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@
@rm -f $@.tmp
$(CC) -M $(CFLAGS) $< -MF $@ -MT $@ -MT $*.o
%.d: %.cpp
@rm -f $@
@$(CXX) -M $(CXXFLAGS) $< > $@.tmp && \
sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@
@rm -f $@.tmp
@$(CXX) -M $(CXXFLAGS) $< -MF $@ -MT $@ -MT $*.o
%.d: %.m
@rm -f $@
@$(CC) -M $(CFLAGS) $< > $@.tmp && \
sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@
@rm -f $@.tmp
@$(CC) -M $(CFLAGS) $< -MF $@ -MT $@ -MT $*.o
%.d: %.mm
@rm -f $@
@$(CXX) -M $(CXXFLAGS) $< > $@.tmp && \
sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@
@rm -f $@.tmp
@$(CXX) -M $(CXXFLAGS) $< -MF $@ -MT $@ -MT $*.o
#----------------------------------------------------------------------
# Include all of the makefiles for each source file so we don't have