-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (24 loc) · 987 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
35
36
CC=gcc
FLAGS=-I. -g -ggdb -Wall -fstack-protector-all -Wstack-protector
LIBS=-L. -lsockets -fstack-protector-all
all: example/server example/client
purge: clean
-rm -f libsockets.so example/server example/client
archive:
-echo TODO: Make a libsockets.tar.gz archive.
package: all clean archive
source: purge archive
clean:
-rm -f sockets.o example/server.o example/client.o
sockets.o: sockets.c sockets.h
$(CC) -c sockets.c -o sockets.o $(FLAGS) -fPIC
example/server.o: example/server.c example/boilerplate.h example/config.h
$(CC) -c example/server.c -o example/server.o $(FLAGS)
example/client.o: example/client.c example/boilerplate.h example/config.h
$(CC) -c example/client.c -o example/client.o $(FLAGS)
libsocket.so: sockets.o
$(CC) --shared sockets.o -o libsockets.so
example/server: example/server.o libsocket.so
$(CC) example/server.o -o example/server $(LIBS)
example/client: example/client.o libsocket.so
$(CC) example/client.o -o example/client $(LIBS)