forked from pEp.foundation/libpEpAdapter
Use compiler to generate .d files instead of using sed.
parent
dc16b1d162
commit
e785f234f8
7
Makefile
7
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
|
||||
|
|
Loading…
Reference in New Issue