-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (31 loc) · 1.15 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
DEBUG = -g
RELEASE = -O3
VERSION = $(RELEASE)
CXXFLAGS = -std=c++14 $(VERSION) -pedantic -pthread
BOTH_LIB := objs/network.o objs/message.o
PAXOS_LIB := objs/paxos.o objs/acceptor.o objs/learner.o objs/proposer.o
REPLICA_LIB := objs/replica_main.o objs/environment.o objs/replica.o objs/kv_store.o $(PAXOS_LIB) $(BOTH_LIB)
CLIENT_LIB := objs/client_lib.o $(BOTH_LIB)
MASTER_LIB := objs/master_main.o objs/master.o objs/shard.o $(BOTH_LIB)
########################################
default: all
all: replica_exec kv_master clients
DEPS := $(wildcard headers/*.h)
.PRECIOUS: objs/%.o
objs/%.o: src/%.cc $(DEPS)
$(CXX) $(CXXFLAGS) -o $@ -c $<
replica_exec: $(REPLICA_LIB)
$(CXX) $(CXXFLAGS) -o bin/$@ $^
kv_master: $(MASTER_LIB)
$(CXX) $(CXXFLAGS) -o bin/$@ $^
CLIENT_SRC :=$(wildcard src/kv_client_*.cc)
CLIENTS := $(patsubst src/%.cc,%.out,$(CLIENT_SRC))
clients: $(CLIENTS)
kv_client_%.out: objs/kv_client_%.o $(CLIENT_LIB)
$(CXX) $(CXXFLAGS) -o bin/$@ $^
########################################
clean:
touch bin/replica_exec bin/kv_master
touch log_0.txt
touch objs/dummy.o bin/dummy.out
rm objs/*.o bin/*.out log_*.txt bin/kv_master bin/replica_exec