-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (79 loc) · 2.64 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
MASTER_LIB = Master
IONODE_LIB = IOnode
SERVER_LIB = Server
CLIENT_LIB = Client
QUERY_LIB = Query_Client
USER_LIB = User_Client
MASTER = master_main
IONODE = node_main
USER_MAIN = user_main
USER_CLIENT = user_client
INCLUDE = include
SRC = src
LIB = lib
BIN = bin
CC = g++
#FLAG = -O3 -Wall
FLAG = -g -Wall
run:
@echo 'run make Master'
@echo 'or make IOnode'
@echo 'or make User_main'
@echo 'or make User_client'
$(SERVER_LIB).o:$(SRC)/$(SERVER_LIB).cpp $(INCLUDE)/$(SERVER_LIB).h
$(CC) -c $(FLAG) -I . -o $(SERVER_LIB).o $(SRC)/$(SERVER_LIB).cpp
$(CLIENT_LIB).o:$(SRC)/$(CLIENT_LIB).cpp $(INCLUDE)/$(CLIENT_LIB).h
$(CC) -c $(FLAG) -I . -o $(CLIENT_LIB).o $(SRC)/$(CLIENT_LIB).cpp
$(QUERY_LIB).o:$(SRC)/$(QUERY_LIB).cpp $(INCLUDE)/$(QUERY_LIB).h
$(CC) -c $(FLAG) -I . -o $(QUERY_LIB).o $(SRC)/$(QUERY_LIB).cpp
$(USER_LIB).o:$(SRC)/$(USER_LIB).cpp $(INCLUDE)/$(USER_LIB).h
$(CC) -c $(FLAG) -I . -lrt -o $(USER_LIB).o $(SRC)/$(USER_LIB).cpp
$(MASTER).o:$(SRC)/$(MASTER_LIB).cpp $(INCLUDE)/$(MASTER_LIB).h
$(CC) -c $(FLAG) -I . -o $(MASTER_LIB).o $(SRC)/$(MASTER_LIB).cpp
$(IONODE).o:$(SRC)/$(IONODE_LIB).cpp $(INCLUDE)/$(IONODE_LIB).h
$(CC) -c $(FLAG) -I . -o $(IONODE_LIB).o $(SRC)/$(IONODE_LIB).cpp
$(MASTER):$(SERVER_LIB).o $(MASTER).o $(SRC)/$(MASTER).cpp
$(CC) $(FLAG) -I . -o $(MASTER) $(SERVER_LIB).o $(MASTER_LIB).o $(SRC)/$(MASTER).cpp
$(IONODE):$(SERVER_LIB).o $(IONODE).o $(SRC)/$(IONODE).cpp $(CLIENT_LIB).o
$(CC) $(FLAG) -I . -o $(IONODE) $(SERVER_LIB).o $(CLIENT_LIB).o $(IONODE_LIB).o $(SRC)/$(IONODE).cpp
$(USER_MAIN):$(CLIENT_LIB).o $(QUERY_LIB).o $(SRC)/$(USER_MAIN).cpp
$(CC) $(FLAG) -I . -o $(USER_MAIN) $(CLIENT_LIB).o $(QUERY_LIB).o $(SRC)/$(USER_MAIN).cpp
$(USER_CLIENT):$(CLIENT_LIB).o $(USER_LIB).o $(SRC)/$(USER_CLIENT).cpp
$(CC) $(FLAG) -I . -lrt -o $(USER_CLIENT) $(USER_LIB).o $(CLIENT_LIB).o $(SRC)/$(USER_CLIENT).cpp
.PHONY:
Master:$(MASTER)
mkdir -p lib
mkdir -p bin
rm -f bin/$(MASTER)
rm -f lib/$(MASTER_LIB).o lib/$(SERVER_LIB).o
mv $(MASTER) bin
mv $(MASTER_LIB).o lib
mv $(SERVER_LIB).o lib
IOnode:$(IONODE)
mkdir -p lib
mkdir -p bin
rm -f bin/$(IONODE)
rm -f lib/$(IONODE_LIB).o lib/$(SERVER_LIB).o lib/$(CLIENT_LIB).o
mv $(IONODE) bin
mv $(IONODE_LIB).o lib
mv $(SERVER_LIB).o lib
mv $(CLIENT_LIB).o lib
User_main:$(USER_MAIN)
mkdir -p lib
mkdir -p bin
rm -f bin/$(USER_MAIN)
rm -f lib/$(QUERY_LIB).o lib/$(CLIENT_LIB).o
mv $(CLIENT_LIB).o lib
mv $(QUERY_LIB).o lib
mv $(USER_MAIN) bin
User_client:$(USER_CLIENT)
mkdir -p lib
mkdir -p bin
rm -f bin/$(USER_CLIENT)
rm -f lib/$(USER_LIB).o lib/$(CLIENT_LIB).o
mv $(CLIENT_LIB).o lib
mv $(USER_LIB).o lib
mv $(USER_CLIENT) bin
clean:
rm $(BIN)/*
rm $(LIB)/*