Commit e5ad244f authored by gejun's avatar gejun

mv libbrpc.dbg.a into test & fix .travis.yml

parent 72a7748b
......@@ -5,9 +5,8 @@ sudo: required
install:
- sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev
- sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libgtest* /usr/lib/ && cd -
- sh config_brpc.sh --headers=/usr/include --libs=/usr/lib
- make -sj8
- cd test && make -sj8
- sh config_brpc.sh --headers=/usr/include --libs=/usr/lib --nodebugsymbols
- make -j4
script:
- cd test && sh ./run_tests.sh
......@@ -180,16 +180,16 @@ PROTOS=$(BRPC_PROTOS) src/idl_options.proto
all: protoc-gen-mcpack libbrpc.a libbrpc.so output/include output/lib output/bin
.PHONY:debug
debug: libbrpc.dbg.a libbvar.dbg.a
debug: test/libbrpc.dbg.a test/libbvar.dbg.a
.PHONY:clean
clean:clean_debug
clean:
@echo "Cleaning"
@rm -rf src/mcpack2pb/generator.o protoc-gen-mcpack libbrpc.a libbrpc.so $(OBJS) output/include output/lib output/bin $(PROTOS:.proto=.pb.h) $(PROTOS:.proto=.pb.cc)
.PHONY:clean_debug
clean_debug:
@rm -rf libbrpc.dbg.a libbvar.dbg.a $(DEBUG_OBJS)
@rm -rf test/libbrpc.dbg.a test/libbvar.dbg.a $(DEBUG_OBJS)
.PRECIOUS: %.o
......@@ -206,11 +206,11 @@ libbrpc.so:$(BRPC_PROTOS:.proto=.pb.h) $(OBJS)
@echo "Linking $@"
@$(CXX) -shared -o $@ $(LIBPATHS) $(SOPATHS) -Xlinker "-(" $(filter %.o,$^) -Xlinker "-)" $(STATIC_LINKINGS) $(DYNAMIC_LINKINGS)
libbvar.dbg.a:$(BVAR_DEBUG_OBJS)
test/libbvar.dbg.a:$(BVAR_DEBUG_OBJS)
@echo "Packing $@"
@ar crs $@ $^
libbrpc.dbg.a:$(BRPC_PROTOS:.proto=.pb.h) $(DEBUG_OBJS)
test/libbrpc.dbg.a:$(BRPC_PROTOS:.proto=.pb.h) $(DEBUG_OBJS)
@echo "Packing $@"
@ar crs $@ $(filter %.o,$^)
......
......@@ -14,7 +14,7 @@ ifeq ($(shell test $(GCC_VERSION) -ge 70000; echo $$?),0)
endif
HDRPATHS=-I. -I../src $(addprefix -I, $(HDRS))
LIBPATHS=-L.. $(addprefix -L, $(LIBS))
LIBPATHS=$(addprefix -L, $(LIBS))
TEST_BUTIL_SOURCES = \
at_exit_unittest.cc \
......@@ -135,38 +135,35 @@ TEST_BINS = test_butil test_bvar $(TEST_BTHREAD_SOURCES:.cpp=) $(TEST_BRPC_SOURC
all: $(TEST_BINS)
.PHONY:clean
clean:clean_bins clean_debug
clean:clean_bins
@echo "Cleaning"
@rm -rf $(TEST_BUTIL_OBJS) $(TEST_BVAR_OBJS) $(TEST_BTHREAD_OBJS) $(TEST_BRPC_OBJS) $(TEST_PROTO_OBJS)
@$(MAKE) -C.. clean_debug
.PHONY:clean_bins
clean_bins:
@rm -rf $(TEST_BINS)
.PHONY:clean_debug
clean_debug:
@$(MAKE) -C.. clean_debug
../libbrpc.dbg.a: FORCE
libbrpc.dbg.a:
@$(MAKE) -C.. debug
FORCE:
.PRECIOUS: %.o
test_butil:../libbrpc.dbg.a $(TEST_BUTIL_OBJS)
test_butil:libbrpc.dbg.a $(TEST_BUTIL_OBJS)
@echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
test_bvar:../libbrpc.dbg.a $(TEST_BVAR_OBJS)
test_bvar:libbrpc.dbg.a $(TEST_BVAR_OBJS)
@echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $(TEST_BVAR_OBJS) ../libbvar.dbg.a -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $(TEST_BVAR_OBJS) libbvar.dbg.a -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
bthread%unittest:../libbrpc.dbg.a bthread%unittest.o
bthread%unittest:libbrpc.dbg.a bthread%unittest.o
@echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
brpc_%_unittest:../libbrpc.dbg.a $(TEST_PROTO_OBJS) brpc_%_unittest.o
brpc_%_unittest:libbrpc.dbg.a $(TEST_PROTO_OBJS) brpc_%_unittest.o
@echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
......@@ -174,11 +171,11 @@ brpc_%_unittest:../libbrpc.dbg.a $(TEST_PROTO_OBJS) brpc_%_unittest.o
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. --proto_path=../src --proto_path=$(PROTOBUF_HDR) $<
%.o:%.cpp
%.o:%.cpp | libbrpc.dbg.a
@echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
%.o:%.cc
%.o:%.cc | libbrpc.dbg.a
@echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
......@@ -2,7 +2,7 @@
test_num=0
failed_test=""
rc=0
make -j8
make -j4
test_bins="test_butil test_bvar bthread*unittest brpc*unittest"
for test_bin in $test_bins; do
test_num=$((test_num + 1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment