Browse Source

Use compiler to generate .d files instead of using sed.

pull/3/head
heck 12 months ago
parent
commit
e785f234f8
1 changed files with 1 additions and 6 deletions
  1. +1
    -6
      Makefile

+ 1
- 6
Makefile View File

@ -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…
Cancel
Save