Skip to content

Commit cc9908d

Browse files
committed
Added a makefile.
1 parent bf4ba6c commit cc9908d

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

server/makefile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
SRCS = colors.c game-structs.c linked_list.c message-processing.c messaging.c player.c reply-processing.c server.c timeout.c
2+
HDRS = colors.h game-structs.h linked_list.h message-processing.h messaging.h player.h reply-processing.h server.h timeout.h
3+
OBJS = colors.o game-structs.o linked_list.o message-processing.o messaging.o player.o reply-processing.o server.o timeout.o
4+
flags = -lm -lpthread
5+
6+
all: server.o
7+
gcc -o server $(OBJS) $(flags)
8+
9+
server.o: colors.o linked_list.o messaging.o message-processing.o server.c server.h timeout.o
10+
gcc -c server.c
11+
12+
colors.o: colors.c colors.h
13+
gcc -c colors.c
14+
15+
messaging.o: messaging.c messaging.h
16+
gcc -c messaging.c
17+
18+
message-processing.o: linked_list.o messaging.o message-processing.c message-processing.h player.o reply-processing.o
19+
gcc -c message-processing.c
20+
21+
player.o: colors.o linked_list.o player.c player.h
22+
gcc -c player.c
23+
24+
reply-processing.o: linked_list.o reply-processing.c reply-processing.h
25+
gcc -c reply-processing.c
26+
27+
timeout.o: reply-processing.o timeout.c timeout.h
28+
gcc -c timeout.c
29+
30+
linked_list.o: game-structs.o linked_list.c linked_list.h
31+
gcc -c linked_list.c
32+
33+
game-structs.o: game-structs.c game-structs.h
34+
gcc -c game-structs.c
35+
36+
clean:
37+
rm -f *.o server

server/server.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "colors.h"
2-
#include "linked_list.h"
32
#include "messaging.h"
43
#include "message-processing.h"
54
#include <pthread.h> //compile with -lpthread

0 commit comments

Comments
 (0)