File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,26 @@ OBJS= \
101101
102102all: bitcoind
103103
104+ # auto-generated dependencies:
105+ -include obj/nogui/*.P
106+ -include obj/test/*.P
104107
105- obj/nogui/%.o: %.cpp $(HEADERS)
106- $(CXX) -c $(CXXFLAGS) -o $@ $<
108+ obj/nogui/%.o: %.cpp
109+ $(CXX) -c $(CXXFLAGS) -MMD -o $@ $<
110+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
111+ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
112+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
113+ rm -f $(@:%.o=%.d)
107114
108115bitcoind: $(OBJS:obj/%=obj/nogui/%)
109116 $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
110117
111- obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
112- $(CXX) -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
118+ obj/test/%.o: test/%.cpp
119+ $(CXX) -c $(CXXFLAGS) -MMD -o $@ $<
120+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
121+ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
122+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
123+ rm -f $(@:%.o=%.d)
113124
114125test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
115126 $(CXX) $(CXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LIBS)
@@ -119,4 +130,6 @@ clean:
119130 -rm -f obj/*.o
120131 -rm -f obj/nogui/*.o
121132 -rm -f obj/test/*.o
122- -rm -f headers.h.gch
133+ -rm -f obj/*.P
134+ -rm -f obj/nogui/*.P
135+ -rm -f obj/test/*.P
You can’t perform that action at this time.
0 commit comments