From c74516f4480965548f364790202b50b1a045cf59 Mon Sep 17 00:00:00 2001 From: Sudeep Sunthankar Date: Fri, 21 Oct 2016 13:13:39 +1100 Subject: [PATCH] 1) Unit tests removed from shared libraary. 2) Fixed issue where make fails on clean checkout. 3) Fixed issue where protobuf objects were not included in shared library, resulting in unreovled references. --- diff --git a/hbase-native-client/Makefile b/hbase-native-client/Makefile index 64cef06..a72f0c9 100644 --- a/hbase-native-client/Makefile +++ b/hbase-native-client/Makefile @@ -35,13 +35,16 @@ LDFLAGS = -lprotobuf -lzookeeper_mt -lsasl2 -lfolly -lwangle LINKFLAG = -shared #define list of source files and object files -SRC = $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cc)) +ALLSRC = $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cc)) +EXCLUDE_SRC = $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*-test.cc)) core/simple-client.cc +SRC = $(filter-out $(EXCLUDE_SRC), $(ALLSRC)) PROTOSRC = $(patsubst %.proto, $(addprefix build/,%.pb.cc),$(wildcard if/*.proto)) DEPS = $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.h)) PROTODEPS = $(patsubst %.proto, $(addprefix build/,%.pb.h),$(wildcard if/*.proto)) DEBUG_OBJ = $(patsubst %.cc,$(DEBUG_PATH)/%.o,$(SRC)) DEBUG_OBJ += $(patsubst %.cc,$(DEBUG_PATH)/%.o,$(PROTOSRC)) RELEASE_OBJ = $(patsubst %.cc,$(RELEASE_PATH)/%.o,$(SRC)) +RELEASE_OBJ += $(patsubst %.cc,$(DEBUG_PATH)/%.o,$(PROTOSRC)) INCLUDES = $(addprefix -I,$(INCLUDE_DIR)) LIB_DIR = /usr/local @@ -54,6 +57,10 @@ ARC_DEBUG=$(DEBUG_PATH)/libHbaseClient_d.a vpath %.cc $(SRC_DIR) +.PHONY: all clean install protos createprotosrc + +build: checkdirs protos $(LIB_DEBUG) $(LIB_RELEASE) $(ARC_DEBUG) $(ARC_RELEASE) + $(LIB_DEBUG): $(DEBUG_BUILD_DIR) define make-goal-dbg $1/%.o: %.cc $(DEPS) $(PROTODEPS) $(PROTOSRC) @@ -66,14 +73,10 @@ $1/%.o: %.cc $(DEPS) $(PROTODEPS) $(PROTOSRC) $(CC) -c $$< -o $$@ $(CPPFLAGS_RELEASE) $(INCLUDES) endef -.PHONY: all clean install - -build: checkdirs protos $(LIB_DEBUG) $(LIB_RELEASE) $(ARC_DEBUG) $(ARC_RELEASE) - checkdirs: $(DEBUG_BUILD_DIR) $(RELEASE_BUILD_DIR) $(PROTO_SRC_DIR) protos: createprotosrc - @make all -f Makefile.protos + @make all -j8 -f Makefile.protos createprotosrc: $(PROTO_SRC_DIR) @protoc --proto_path=if --cpp_out=$(PROTO_SRC_DIR) if/*.proto @@ -107,7 +110,7 @@ $(LIB_DEBUG): $(DEBUG_OBJ) #to clean re-compilable files clean: - @rm -rf $(DEBUG_BUILD_DIR) $(RELEASE_BUILD_DIR) $(LIB_RELEASE) $(LIB_DEBUG) $(ARC_RELEASE) $(ARC_DEBUG) docs buck-out build + @rm -rf docs buck-out build $(foreach bdir,$(DEBUG_BUILD_DIR), $(eval $(call make-goal-dbg,$(bdir)))) @@ -129,4 +132,3 @@ help: @echo " protos : will build the corresponding sources for protobufs present in if/ directory." all: build doc check - -- 1.8.3.1