-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (23 loc) · 968 Bytes
/
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
SHELL := /bin/bash
GEN_SRC := server.cpp dkvs.cpp store_types.cpp store_constants.cpp
GEN_OBJ := $(patsubst %.cpp,%.o, $(GEN_SRC))
THRIFT_DIR := /home/cs557-inst/local/include
LIB_DIR := /home/cs557-inst/local/lib
INC := -I$(THRIFT_DIR) -Isrc/ -I$(THRIFT_DIR)/thrift
.PHONY: all clean
all:server client
mkdir logs
%.o:gen-cpp/%.cpp
$(CXX) -g -std=c++17 -Wall -Wextra -pedantic -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H $(INC) -c $< -o $@
server:server.o $(GEN_OBJ)
$(CXX) -g $^ -o $@ -std=c++17 -lstdc++ -L$(LIB_DIR) -lthrift
client:
g++ -g -std=c++17 -Wall -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -I/home/cs557-inst/local/include -Isrc/ -I/home/cs557-inst/local/include/thrift -c gen-cpp/client.cpp -o client.o
g++ -g client.o dkvs.o store_types.o store_constants.o -o client -std=c++17 -L/home/cs557-inst/local/lib/ -lthrift
run:
source ~/.bashrc && ./server 1_snitch.txt
start: all run
restart:clean all
clean:
$(RM) *.o server client
rm -rf logs 128.*