forked from CarterLi/liburing4cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (33 loc) · 1.57 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
CXX_COMPILER ?= clang++
MODE ?= DEBUG
ifeq ($(MODE),DEBUG)
CXXFLAGS ?= -O0 -rdynamic -D_LIBCPP_DEBUG_LEVEL=1 -fno-omit-frame-pointer -fsanitize=address
else
CXXFLAGS ?= -O3 -DNDEBUG -march=native
endif
ifeq ($(CXX_COMPILER),clang++)
override CXXFLAGS += -fcoroutines-ts -stdlib=libc++ -lc++ -lc++abi
else
override CXXFLAGS += -fcoroutines
endif
override CXXFLAGS += -g -Wall -std=c++17 -I.. -lfmt -luring -pthread
all_targets = file_server http_client link_cp threading test bench echo_server
all: $(all_targets)
clean:
rm -f $(all_targets)
help:
@echo 'make [MODE={DEBUG,RELEASE}] [CXX_COMPILER={g++|clang++}]'
file_server: file_server.cpp ../include/task.hpp ../include/io_service.hpp
$(CXX_COMPILER) ./file_server.cpp -I../include -o file_server $(CXXFLAGS)
http_client: http_client.cpp ../include/task.hpp ../include/io_service.hpp
$(CXX_COMPILER) ./http_client.cpp -I../include -o http_client $(CXXFLAGS)
link_cp: link_cp.cpp ../include/task.hpp ../include/io_service.hpp
$(CXX_COMPILER) ./link_cp.cpp -I../include -o link_cp $(CXXFLAGS)
threading: threading.cpp ../include/task.hpp ../include/io_service.hpp
$(CXX_COMPILER) ./threading.cpp -I../include -o threading $(CXXFLAGS)
test: test.cpp ../include/task.hpp ../include/io_service.hpp
$(CXX_COMPILER) ./test.cpp -I../include -o test $(CXXFLAGS)
bench: bench.cpp ../include/task.hpp ../include/io_service.hpp
$(CXX_COMPILER) ./bench.cpp -I../include -o bench $(CXXFLAGS)
echo_server: echo_server.cpp ../include/task.hpp ../include/io_service.hpp
$(CXX_COMPILER) ./echo_server.cpp -I../include -o echo_server $(CXXFLAGS)