-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
105 lines (69 loc) · 3.49 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
104
105
#
# Makefile for miniGFS, ecs251 and ecs36b
#
CC = g++ -std=c++14
# CFLAGS = -g
# for most Linux environments, but might need to be changed to find json stuff
CFLAGS = -g -I/usr/include/jsoncpp
# CFLAGS = -g -Wall -Wstrict-prototypes
# CFLAGS = -O3
# the following, RPCG, are JSONRPC generated files
RPCG_INCS = minigfs_client.h minigfs_server.h
# all files inherited from Core objects plus the RPCG stuff
CORE_INCS = Core.h Directory.h Shadow_Directory.h Replica.h Shadow_Replica.h $(RPCG_INCS)
CORE_OBJS = Core.o Directory.o Shadow_Directory.o Replica.o Shadow_Replica.o
# libraries needed for JSON and JSONRPC
LDFLAGS_SV = -ljsoncpp -lmicrohttpd -ljsonrpccpp-common -ljsonrpccpp-server
LDFLAGS_CL = -ljsoncpp -lcurl -ljsonrpccpp-common -ljsonrpccpp-client
# executable
EXE_FILES = minigfs_client1 minigfs_client2 minigfs_read minigfs_master minigfs_primary minigfs_secondary_A minigfs_secondary_B
# rules
all: minigfs_client1 minigfs_client2 minigfs_master minigfs_primary minigfs_secondary_A minigfs_secondary_B minigfs_read
# why do I need this line?
minigfs_client.h: minigfs.json
jsonrpcstub minigfs.json --cpp-server=minigfs_Server --cpp-client=minigfs_Client
minigfs_server.h: minigfs.json
jsonrpcstub minigfs.json --cpp-server=minigfs_Server --cpp-client=minigfs_Client
base64.o: base64.cpp base64.h
$(CC) -c $(CFLAGS) base64.cpp
Core.o: Core.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) Core.cpp
Directory.o: Directory.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) Directory.cpp
Shadow_Directory.o: Shadow_Directory.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) Shadow_Directory.cpp
Replica.o: Replica.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) Replica.cpp
Shadow_Replica.o: Shadow_Replica.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) Shadow_Replica.cpp
minigfs_client1.o: minigfs_client1.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) minigfs_client1.cpp
minigfs_client2.o: minigfs_client2.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) minigfs_client2.cpp
minigfs_master.o: minigfs_master.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) minigfs_master.cpp
minigfs_primary.o: minigfs_primary.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) minigfs_primary.cpp
minigfs_secondary_A.o: minigfs_secondary_A.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) minigfs_secondary_A.cpp
minigfs_secondary_B.o: minigfs_secondary_B.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) minigfs_secondary_B.cpp
minigfs_read.o: minigfs_read.cpp $(CORE_INCS)
$(CC) -c $(CFLAGS) minigfs_read.cpp
minigfs_client1: $(CORE_OBJS) minigfs_client1.o base64.o
$(CC) -o minigfs_client1 $(CORE_OBJS) minigfs_client1.o base64.o $(LDFLAGS_SV) $(LDFLAGS_CL)
minigfs_client2: $(CORE_OBJS) minigfs_client2.o base64.o
$(CC) -o minigfs_client2 $(CORE_OBJS) minigfs_client2.o base64.o $(LDFLAGS_SV) $(LDFLAGS_CL)
minigfs_master: $(CORE_OBJS) minigfs_master.o base64.o
$(CC) -o minigfs_master $(CORE_OBJS) minigfs_master.o base64.o $(LDFLAGS_SV) $(LDFLAGS_CL)
minigfs_primary: $(CORE_OBJS) minigfs_primary.o base64.o
$(CC) -o minigfs_primary $(CORE_OBJS) minigfs_primary.o base64.o $(LDFLAGS_SV) $(LDFLAGS_CL)
minigfs_secondary_A: $(CORE_OBJS) minigfs_secondary_A.o base64.o
$(CC) -o minigfs_secondary_A $(CORE_OBJS) minigfs_secondary_A.o base64.o $(LDFLAGS_SV) $(LDFLAGS_CL)
minigfs_secondary_B: $(CORE_OBJS) minigfs_secondary_B.o base64.o
$(CC) -o minigfs_secondary_B $(CORE_OBJS) minigfs_secondary_B.o base64.o $(LDFLAGS_SV) $(LDFLAGS_CL)
minigfs_read: $(CORE_OBJS) minigfs_read.o base64.o
$(CC) -o minigfs_read $(CORE_OBJS) minigfs_read.o base64.o $(LDFLAGS_SV) $(LDFLAGS_CL)
clean:
rm -f *.o *~ core $(EXE_FILES) $(RPCG_INCS)
# end of the Makefile