-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
34 lines (24 loc) · 802 Bytes
/
makefile
File metadata and controls
34 lines (24 loc) · 802 Bytes
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
CXX ?= g++
DEBUG ?= 1
ifeq ($(DEBUG), 1)
CXXFLAGS += -g
else
CXXFLAGS += -O2
endif
INCLUDES = -I./include # 添加多个路径,空格分隔
CFLAGS = -Wall $(INCLUDES) # 将路径整合到编译选项
t_mutex1 : ./test/t_mutex1.cpp
$(CXX) -o t_mutex1 $^ $(CXXFLAGS) -lpthread
t_mutex2 : ./test/t_mutex2.cpp
$(CXX) -o t_mutex2 $^ $(CXXFLAGS) -lpthread
# test for condition variables
t_cond1 : ./test/t_cond1.cpp
$(CXX) -o t_cond1 $^ $(CXXFLAGS) -lpthread
t_semaphore1 : ./test/t_semaphore1.cpp
$(CXX) -o t_semaphore1 $^ $(CXXFLAGS) -lpthread
t_mysql1 : ./test/t_mysql1.cpp
$(CXX) -o t_mysql1 $^ $(CXXFLAGS) -lmysqlclient
valint-nc : ./test/valint-nc.cpp
$(CXX) -o valint-nc $^ $(CXXFLAGS)
clean:
rm -f t_mutex1 t_mutex2 t_cond1 t_semaphore1 t_mysql1 valint-nc