-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
34 lines (20 loc) · 721 Bytes
/
makefile
File metadata and controls
34 lines (20 loc) · 721 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
COMPILER = g++
OUTPUT_TARGET = libevhttp.so
CPL_FLAGS = -g -std=c++11 -fPIC
CPL_INCLUDES = -Isrc -Iinclude -I3rd/linux/include
LNK_LIB_PATH = -L3rd/linux/lib
LNK_FLAGS = -shared -pthread
LNK_LIB_NAMES = -levent -levent_pthreads -lcrypto -lssl
SRCS := $(wildcard src/*.cpp)
OBJS := $(patsubst %cpp,%o,$(SRCS))
all:$(OBJS)
$(COMPILER) -o $(OUTPUT_TARGET) $(LNK_FLAGS) $(OBJS) $(LNK_LIB_PATH) $(LNK_LIB_NAMES)
%.o:%.cpp
$(COMPILER) -c $(CPL_FLAGS) $(CPL_INCLUDES) $< -o $@
clean:
rm -rf $(OUTPUT_TARGET) $(OBJS) $(TEST_OBJS) simple
TEST_SRCS := $(wildcard test/*.cpp)
TEST_OBJS := $(patsubst %cpp,%o,$(TEST_SRCS))
.PHONY: test
test:$(TEST_OBJS)
$(COMPILER) -o simple test/simple.o -L./ -levhttp -lpthread