-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile.osx
65 lines (52 loc) · 2.98 KB
/
makefile.osx
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
60
61
62
63
64
65
LIBNAME = solwrap
SONAME = lib$(LIBNAME).so
SOLWRAP_DIR = $(CURDIR)/includes/solwrap
SOLCLIENT_DIR = $(CURDIR)/includes/solclient
LIB_DIR = $(CURDIR)/lib.osx
BUILD_DIR = $(CURDIR)/bin
PYINC=
PYLIB=
PYDEF=
INCDIRS = $(SOLCLIENT_DIR)/include $(SOLWRAP_DIR)/include
LIBDIRS = $(CURDIR) $(SOLCLIENT_DIR)/lib.osx
STATIC_LIBS = $(CURDIR)/lib.osx/libsolwrap.a $(SOLCLIENT_DIR)/lib.osx/libsolclient.a $(SOLCLIENT_DIR)/lib.osx/libcrypto.a $(SOLCLIENT_DIR)/lib.osx/libssl.a -lgssapi_krb5
WRAP_LIBS = pthread
WRAP_BIN_LIBS = pthread
WRAP_GO_LIBS = pthread stdc++
SYMS = PROVIDE_LOG_UTILITIES SOLCLIENT_CONST_PROPERTIES _REENTRANT _osx_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) -std=c++11 -m64 $(DEBUG)
CXXFLAGS = $(foreach d, $(INCDIRS), -I$d) $(foreach s, $(SYMS), -D$s) -std=c++11 -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.osx/libcrypto.a $(LIB_DIR)
@cp $(SOLCLIENT_DIR)/lib.osx/libsolclient.1.dylib $(LIB_DIR)
@cp $(SOLCLIENT_DIR)/lib.osx/libsolclient.a $(LIB_DIR)
@cp $(SOLCLIENT_DIR)/lib.osx/libsolclient.a.7.14.0.8 $(LIB_DIR)
@cp $(SOLCLIENT_DIR)/lib.osx/libsolclientssl.a $(LIB_DIR)
@cp $(SOLCLIENT_DIR)/lib.osx/libssl.1.1.dylib $(LIB_DIR)
@cp $(SOLCLIENT_DIR)/lib.osx/libssl.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.osx $(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 && GOOS=darwin GOARCH=amd64 go build -o ../bin/pub.example.osx example.publisher.go
@cd examples && GOOS=darwin GOARCH=amd64 go build -o ../bin/sub.example.osx example.subscriber.go