-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
38 lines (29 loc) · 1019 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
DEFINES= -D_GLIBCXX_USE_SCHED_YIELD -D_GLIBCXX_USE_NANOSLEEP -DBOOST_COROUTINE_NO_DEPRECATION_WARNING=1 -DBOOST_COROUTINES_NO_DEPRECATION_WARNING
SSL_LIBS = -lssl -lcrypto
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
ifeq ($(CXX),clang++)
LIBS= -pthread -lc++abi -lboost_coroutine -lboost_context -lboost_system
else
LIBS= -lboost_coroutine -lboost_context -lboost_system $(SSL_LIBS)
endif
endif
ifeq ($(UNAME), Darwin)
LIBS= -lboost_coroutine-mt -lboost_context-mt -lboost_system-mt $(SSL_LIBS)
endif
ARGS= -std=c++11 -g -Wall -Werror -Wextra -pedantic-errors -pthread $(INCLUDES) $(DEFINES)
ifeq ($(CXX),clang++)
standard_library = -stdlib=libc++
else
standard_library =
endif
SOURCES = $(wildcard *.cpp)
OBJS = $(addprefix ./, $(notdir $(SOURCES:.cpp=.o)))
%.o: %.cpp
$(CXX) $(standard_library) $(ARGS) $(CXXFLAGS) $(ADD_INC_FLAGS) -c $< -o $@
test_main: $(OBJS)
$(CXX) $(standard_library) $(ARGS) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) $(ADD_LIB_FLAGS)
test:
./test_main
clean:
rm *.o test_main