aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-01-23 15:16:59 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-01-23 15:16:59 -0500
commit2a9b46cf4b93494c487f0a44bf0f8c08fb2bd1b8 (patch)
treefc5de416b385099febfb1284da0cf425aa101973
parenta702ceaafca55ab665058eae57c1a5a40921b866 (diff)
parent34c69036dae7b4be100100cc99eb1dbe32fe1bef (diff)
Merge branch 'bugfix_shared_boost_test' of https://github.com/luke-jr/bitcoin
-rw-r--r--src/makefile.unix16
-rw-r--r--src/obj-test/.gitignore2
2 files changed, 11 insertions, 7 deletions
diff --git a/src/makefile.unix b/src/makefile.unix
index 3c6be3ee41..41452dec81 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -16,6 +16,8 @@ ifdef STATIC
ifeq (${STATIC}, all)
LMODE2 = static
endif
+else
+ TESTDEFS += -DBOOST_TEST_DYN_LINK
endif
# for boost 1.37, add -mt to the boost libraries
@@ -109,7 +111,7 @@ all: bitcoind
# auto-generated dependencies:
-include obj/*.P
--include obj/test/*.P
+-include obj-test/*.P
obj/%.o: %.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
@@ -121,21 +123,21 @@ obj/%.o: %.cpp
bitcoind: $(OBJS:obj/%=obj/%)
$(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
-TESTOBJS := $(patsubst test/%.cpp,obj/test/%.o,$(wildcard test/*.cpp))
+TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
-obj/test/%.o: test/%.cpp
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+obj-test/%.o: test/%.cpp
+ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
- $(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
+ $(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
clean:
-rm -f bitcoind test_bitcoin
-rm -f obj/*.o
- -rm -f obj/test/*.o
+ -rm -f obj-test/*.o
-rm -f obj/*.P
- -rm -f obj/test/*.P
+ -rm -f obj-test/*.P
diff --git a/src/obj-test/.gitignore b/src/obj-test/.gitignore
new file mode 100644
index 0000000000..d6b7ef32c8
--- /dev/null
+++ b/src/obj-test/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore