-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
144 lines (96 loc) · 3.97 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
CC = gcc
OBJDIR = build
SRCDIR = src
BINDIR = bin
INCDIR = /
FLAGS = -g
SRC = $(wildcard $(SRCDIR)/*.c)
OBJ = $(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRC))
OBJ_SERV = build/whoServer.o build/circular_buffer.o build/whoServer_thread_functions.o build/util.o build/message_handlers.o build/master_functions.o build/socket_functions.o build/queries_master.o
OBJ_CLNT = build/whoClient.o build/whoClient_thread_functions.o build/util.o build/message_handlers.o build/master_functions.o build/socket_functions.o build/whoClient_thread_functions.o build/queries_master.o build/queries_list.o
OBJ_MSTR = build/master.o build/message_handlers.o build/util.o build/date.o build/hashtable.o build/patient_list.o build/ht_avlt.o build/avl_tree.o build/queries_master.o build/master_functions.o
OBJ_WORK = build/worker.o build/message_handlers.o build/util.o build/date.o build/hashtable.o build/patient_list.o build/ht_avlt.o build/avl_tree.o build/queries_worker.o build/worker_functions.o build/socket_functions.o
.PHONY: all clean mainexe
all: whoServer_ whoClient_ master_ worker_
whoServer_: whoServer
whoClient_: whoClient
master_ : master
worker_ : worker
whoServer: $(OBJ_SERV)
echo compiling $?
$(CC) $(FLAGS) -o $@ $^ -lm -lpthread
whoClient: $(OBJ_CLNT)
echo compiling $?
$(CC) $(FLAGS) -o $@ $^ -lm -lpthread
master: $(OBJ_MSTR)
echo compiling $?
$(CC) $(FLAGS) -o $@ $^ -lm -lpthread
worker: $(OBJ_WORK)
echo compiling $?
$(CC) $(FLAGS) -o $@ $^ -lm -lpthread
$(OBJDIR)/whoServer.o: $(SRCDIR)/whoServer.c
echo compiling $? $@
$(CC) $(FLAGS) -c $^ -o $@ -lpthread
$(OBJDIR)/whoClient.o: $(SRCDIR)/whoClient.c
echo compiling $? $@
$(CC) $(FLAGS) -c $^ -o $@ -lpthread
$(OBJDIR)/master.o: $(SRCDIR)/master.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/worker.o: $(SRCDIR)/worker.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/socket_functions.o: $(SRCDIR)/socket_functions.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/circular_buffer.o: $(SRCDIR)/circular_buffer.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/whoServer_thread_functions.o: $(SRCDIR)/whoServer_thread_functions.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/whoClient_thread_functions.o: $(SRCDIR)/whoClient_thread_functions.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/queries_list.o: $(SRCDIR)/queries_list.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/message_handlers.o: $(SRCDIR)/message_handlers.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/util.o: $(SRCDIR)/util.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/hashtable.o: $(SRCDIR)/hashtable.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/date.o: $(SRCDIR)/date.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/ht_avlt.o: $(SRCDIR)/ht_avlt.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/avl_tree.o: $(SRCDIR)/avl_tree.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/patient_list.o: $(SRCDIR)/patient_list.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/queries_master.o: $(SRCDIR)/queries_master.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/queries_worker.o: $(SRCDIR)/queries_worker.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/master_functions.o: $(SRCDIR)/master_functions.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
$(OBJDIR)/worker_functions.o: $(SRCDIR)/worker_functions.c
echo compiling $? $@
$(CC) $(FLAGS) -I$(INCDIR) -c $^ -o $@ -lpthread
clean:
rm $(OBJDIR)/*.o
rm worker
rm master
rm whoServer
rm whoClient