-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·59 lines (46 loc) · 1.32 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
#################################################
# Definitions & variables
#
BINCLIENT = client
BINSERVER = server
OBJSCLIENT = $(BINCLIENT:=.o) client_func.o common.o
OBJSSERVER = $(BINSERVER:=.o) server_func.o common.o database.o
CFLAGS = -g -O2 -Wall -pedantic -ansi -w -std=c99
#################################################
# All section
###
all: $(BINCLIENT) $(BINSERVER)
#################################################
# Client section
###
$(BINCLIENT): $(OBJSCLIENT)
$(CC) $(CFLAGS) -o $(BINCLIENT) $(OBJSCLIENT)
client.o: client.c
$(CC) $(CFLAGS) -c client.c
client_func.o: client_func.c
$(CC) $(CFLAGS) -c client_func.c
#################################################
# Server section
###
$(BINSERVER): $(OBJSSERVER)
$(CC) $(CFLAGS) -o $(BINSERVER) $(OBJSSERVER)
server.o: server.c
$(CC) $(CFLAGS) -c server.c
server_func.o: server_func.c
$(CC) $(CFLAGS) -c server_func.c
database.o: database.c
$(CC) $(CFLAGS) -c database.c
#################################################
# Common section
###
common.o: common.c
$(CC) $(CFLAGS) -c common.c
#################################################
# Clean section
###
clean:
rm -rf *.log *~ $(BINCLIENT) $(BINSERVER) $(OBJSCLIENT) $(OBJSSERVER)
cleancli:
rm -rf *.log core *~ $(BINCLIENT) $(OBJSCLIENT)
cleanser:
rm -rf *.log core *~ $(BINSERVER) $(OBJSSERVER)