forked from OSchip/llvm-project
Fix makefile rules to prevent CFLAGS from appearing twice in the command line.
llvm-svn: 136917
This commit is contained in:
parent
d61b1d505c
commit
189bff103d
|
@ -158,28 +158,27 @@ endif
|
|||
# the compiler -MM option. The -M option will list all system headers,
|
||||
# and the -MM option will list all non-system dependencies.
|
||||
#----------------------------------------------------------------------
|
||||
CPPFLAGS ?= $(CFLAGS)
|
||||
%.d: %.c
|
||||
@set -e; rm -f $@; \
|
||||
$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
|
||||
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
%.d: %.cpp
|
||||
@set -e; rm -f $@; \
|
||||
$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
|
||||
$(CC) -M $(CXXFLAGS) $< > $@.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
%.d: %.m
|
||||
@set -e; rm -f $@; \
|
||||
$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
|
||||
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
%.d: %.mm
|
||||
@set -e; rm -f $@; \
|
||||
$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
|
||||
$(CC) -M $(CXXFLAGS) $< > $@.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
|
|
Loading…
Reference in New Issue