-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (37 loc) · 1.18 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
CC=gcc
AR = ar
ARFLAGS = ru
RANLIB = ranlib
CFLAGS= -g
SRCS= client.c server.c
LIBS = -L./SocketLibrary/
all:: socketlib client server example_thread threadpool_test
strip client
strip server
strip example_thread
strip threadpool_test
socketlib:
cd SocketLibrary && make
example_thread: example_thread.o
$(CC) -o example_thread example_thread.o -lpthread
client: client.o common.o
$(CC) -o client client.o common.o $(LIBS) -lsock -lpthread
server: server.o common.o threadpool.o
$(CC) -o server server.o common.o threadpool.o $(LIBS) -lsock -lpthread
threadpool_test: threadpool_test.o threadpool.o
$(CC) -o threadpool_test threadpool_test.o threadpool.o -lpthread
client.o: client.c common.h
$(CC) -o client.o -c client.c
server.o: server.c common.h
$(CC) -o server.o -c server.c
common.o: common.c
$(CC) -o common.o -c common.c
example_thread.o: example_thread.c
$(CC) -o example_thread.o -c example_thread.c
threadpool.o: threadpool.c
$(CC) -o threadpool.o -c threadpool.c
threadpool_test.o: threadpool_test.c threadpool.h
$(CC) -o threadpool_test.o -c threadpool_test.c
clean:
/bin/rm -f client server example_thread threadpool_test *.o core *~ #*
cd SocketLibrary && make clean