-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
executable file
·104 lines (76 loc) · 2.62 KB
/
Makefile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Makefile
#
# Generated by phxrpc_pb2server from kvraft.proto
#
#
include /home/qyj/code/phxrpc/phxrpc.mk
LDFLAGS := -L$(PHXRPC_ROOT)/lib -lphxrpc $(LDFLAGS) -lleveldb
# choose to use boost for network
#LDFLAGS := $(PLUGIN_BOOST_LDFLAGS) $(LDFLAGS)
SVR_OBJS = kvraft.pb.o \
raft.o \
kvraft_service_impl.o \
phxrpc_kvraft_service.o \
phxrpc_kvraft_dispatcher.o \
kvraft_server_config.o \
kvraft_main.o \
kvraft_client_uthread.o \
phxrpc_kvraft_stub.o \
kvserver.o \
snapshot.o \
leveldb_storage.o
CLI_OBJS = kvraft.pb.o \
kvraft_client.o \
kvraft_client_uthread.o \
phxrpc_kvraft_stub.o
TARGETS = libkvraft_client.a kvraft_main kvraft_tool_main kvraft_client
all: $(TARGETS)
kvraft_main: $(SVR_OBJS)
$(LINKER) $^ $(LDFLAGS) -o $@
kvraft_client:$(CLI_OBJS) kvclient.o
$(LINKER) $^ $(LDFLAGS) -o $@
libkvraft_client.a: $(CLI_OBJS)
$(AR) $@ $^
kvraft_tool_main: phxrpc_kvraft_tool.o kvraft_tool_impl.o kvraft_tool_main.o
$(LINKER) $^ -L. -lkvraft_client $(LDFLAGS) -o $@
########## kvraft ##########
raft.o: raft.h kvraft_client_uthread.h
kvserver.o: kvserver.h
leveldb_storage.o: leveldb_storage.h storage.h
snapshot.o: snapshot.h leveldb_storage.h storage.h
########## message ##########
kvraft.pb.cc: kvraft.pb.h
kvraft.pb.h: kvraft.proto
$(PROTOBUF_ROOT)/bin/protoc -I$(PROTOBUF_ROOT)/include --cpp_out=. -I$(PHXRPC_ROOT) -I. $^
########## client ##########
phxrpc_kvraft_stub.cpp: phxrpc_kvraft_stub.h
phxrpc_kvraft_stub.o: phxrpc_kvraft_stub.h
kvraft_client.cpp: phxrpc_kvraft_stub.h
kvraft_client.o: phxrpc_kvraft_stub.h
kvraft_client_uthread.cpp: phxrpc_kvraft_stub.h
kvraft_client_uthread.o: phxrpc_kvraft_stub.h
phxrpc_kvraft_stub.h: kvraft.proto
$(PHXRPC_ROOT)/codegen/phxrpc_pb2client $(PBFLAGS) -f $^ -d . -u
########## service ##########
phxrpc_kvraft_service.cpp: phxrpc_kvraft_service.h
phxrpc_kvraft_service.o: phxrpc_kvraft_service.h
kvraft_service_impl.cpp: phxrpc_kvraft_service.h
kvraft_service_impl.o: phxrpc_kvraft_service.h
phxrpc_kvraft_dispatcher.cpp: phxrpc_kvraft_service.h
phxrpc_kvraft_dispatcher.o: phxrpc_kvraft_service.h
phxrpc_kvraft_service.h: kvraft.proto
$(PHXRPC_ROOT)/codegen/phxrpc_pb2service $(PBFLAGS) -f $^ -d . -u
########## tool ##########
phxrpc_kvraft_tool.cpp: phxrpc_kvraft_tool.h
phxrpc_kvraft_tool.o: phxrpc_kvraft_tool.h
kvraft_tool_impl.cpp: phxrpc_kvraft_tool.h
kvraft_tool_impl.o: phxrpc_kvraft_tool.h
kvraft_tool_main.cpp: phxrpc_kvraft_tool.h
kvraft_tool_main.o: phxrpc_kvraft_tool.h
phxrpc_kvraft_tool.h: kvraft.proto
$(PHXRPC_ROOT)/codegen/phxrpc_pb2tool $(PBFLAGS) -f $^ -d .
clean:
@($(RM) $(TARGETS))
@($(RM) *.o)
@($(RM) phxrpc_*)
@($(RM) *.pb.*)