-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (49 loc) · 1005 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
##
# Variables
##
CC=gcc
CFLAGS=-Wall -Wextra -pedantic
DFLAGS=-DDEBUG_PRINT_ENABLED -DDEBUG_LOG_ENABLED -DDEBUG_ERR_ENABLED
OUTC=ipk-client
OUTS=ipk-server
##
# Translate all
##
all:
make client
make server
# debug
debug: DEBUG_client.o DEBUG_server.o
$(CC) $(CFLAGS) client.o -o $(OUTC)
$(CC) $(CFLAGS) server.o -o $(OUTS)
##
# Translate client
##
client: client.o
$(CC) $(CFLAGS) client.o -o $(OUTC)
client.o: client.c
$(CC) $(CFLAGS) client.c -c
# debug
debug-client: DEBUG_client.o
$(CC) $(CFLAGS) client.o -o $(OUTC)
# debug
DEBUG_client.o: client.c
$(CC) $(CFLAGS) $(DFLAGS) client.c -c
##
# Translate server
##
server: server.o
$(CC) $(CFLAGS) server.o -o $(OUTS)
server.o: server.c
$(CC) $(CFLAGS) server.c -c
# debug
debug-server: DEBUG_server.o
$(CC) $(CFLAGS) server.o -o $(OUTS)
# debug
DEBUG_server.o: server.c
$(CC) $(CFLAGS) $(DFLAGS) server.c -c
##
# Clear all
##
clean:
rm -f *.o $(OUT) $(OUTS) $(OUTC)