-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile.linux
59 lines (46 loc) · 2.46 KB
/
makefile.linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
LIBNAME = solwrap
SONAME = lib$(LIBNAME).so
SOLWRAP_DIR = $(CURDIR)/includes/solwrap
SOLCLIENT_DIR = $(CURDIR)/includes/solclient
LIB_DIR = $(CURDIR)/lib.linux
BUILD_DIR = $(CURDIR)/bin
PYINC=
PYLIB=
PYDEF=
INCDIRS = $(SOLCLIENT_DIR)/include $(SOLWRAP_DIR)/include
LIBDIRS = $(CURDIR) $(SOLCLIENT_DIR)/lib.linux
STATIC_LIBS = $(CURDIR)/lib.linux/libsolwrap.a $(SOLCLIENT_DIR)/lib.linux/libsolclient.a
WRAP_LIBS = pthread
WRAP_BIN_LIBS = pthread rt
WRAP_GO_LIBS = pthread rt stdc++
SYMS = PROVIDE_LOG_UTILITIES SOLCLIENT_CONST_PROPERTIES _REENTRANT _LINUX_X86_64
DEBUG = -g
SOL_SRC = $(wildcard $(SOLWRAP_DIR)/src/*.cpp)
SOL_TEST = $(wildcard ./bin/*.test)
CXXFLAGS_LIB = $(foreach d, $(INCDIRS), -I$d) $(foreach s, $(SYMS), -D$s) -m64 $(DEBUG)
CXXFLAGS = $(foreach d, $(INCDIRS), -I$d) $(foreach s, $(SYMS), -D$s) -m64 $(DEBUG)
WRAPPER_LIBS = $(foreach l, $(WRAP_LIBS), -l$l)
WRAPPER_GO_LIBS = $(foreach l, $(WRAP_GO_LIBS), -l$l)
WRAPPER_BIN_LIBS = $(foreach l, $(WRAP_BIN_LIBS), -l$l)
RUN_TESTS = $(foreach b, $(SOL_TEST), printf "\n$(b)\n=====================\n" && ./$(b) &&) printf "==========\n"
all: $(SONAME)
$(SONAME): $(SOL_SRC)
@echo "=============================="
@$(CC) --version
@$(CXX) --version
@echo "=============================="
@mkdir -p $(LIB_DIR)
@mkdir -p $(BUILD_DIR)
@cp $(SOLCLIENT_DIR)/lib.linux/libsolclient.a* $(LIB_DIR)
@cd $(LIB_DIR) && $(CXX) -c $(CXXFLAGS_LIB) $(SOL_SRC) $(WRAPPER_LIBS) -fPIC && ar -rcs libsolwrap.a *.o && rm *.o
lib-tests:
$(CXX) $(CXXFLAGS) -o $(BUILD_DIR)/direct.test.linux $(SOLWRAP_DIR)/tests/direct_test.cpp $(STATIC_LIBS) $(WRAPPER_BIN_LIBS)
# $(CXX) $(CXXFLAGS) -o $(BUILD_DIR)/persistent.test $(SOLWRAP_DIR)/tests/persistent_test.cpp $(STATIC_LIBS) $(WRAPPER_BIN_LIBS)
# $(CXX) $(CXXFLAGS) -o $(BUILD_DIR)/subscribe.test $(SOLWRAP_DIR)/tests/bulk_subscribe_test.cpp $(STATIC_LIBS) $(WRAPPER_BIN_LIBS)
# $(CC) $(CXXFLAGS) -o $(BUILD_DIR)/c_client.test $(SOLWRAP_DIR)/tests/c_client_test.c $(STATIC_LIBS) $(WRAPPER_BIN_LIBS)
# $(CXX) $(CXXFLAGS) -o $(BUILD_DIR)/cache.test $(SOLWRAP_DIR)/tests/cache_test.cpp $(STATIC_LIBS) $(WRAPPER_BIN_LIBS)
test:
$(RUN_TESTS)
examples:
@cd examples && go build -o ../bin/pub.example.linux example.publisher.go
@cd examples && go build -o ../bin/sub.example.linux example.subscriber.go