-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (32 loc) · 1.04 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
####################################################################
# For building: ALL_T
# make version: GNU Make 3.82
# g++ version: gcc version 4.5.1
# gcc version: g++ version 4.5.1
####################################################################
#### === CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT === ####
########## Compiler, tools and options
CC = gcc
CFLAGS = -O2 -Wall -g $(DEFINES)
CXXFLAGS = -O2 -Wall -g $(DEFINES)
# all target
ALL_T = server client
# all object
CORE_OBJ = global.o
CLIENT_OBJ = client.o
SERVER_OBJ = server.o
ALL_OBJ = $(CORE_OBJ) $(CLIENT_OBJ) $(SERVER_OBJ)
# Targets start here
all: $(ALL_OBJ) $(ALL_T)
client: $(CORE_OBJ) $(CLIENT_OBJ)
$(CC) $(CFLAGS) -o $@ -lpthread $(CORE_OBJ) $(CLIENT_OBJ)
server: $(CORE_OBJ) $(SERVER_OBCLIENT_OBJ)
$(CC) $(CFLAGS) -o $@ -lpthread $(CORE_OBJ) $(SERVER_OBJ)
clean:
$(RM) $(ALL_OBJ) $(ALL_T)
# list targets that do not create files
.PHONY: clean all
# DO NOT DELETE
global.o : global.c global.h
client.o : client.c global.h
server.o : server.c global.h