-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (39 loc) · 1.25 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
48
49
50
51
FLAGS = -Wall -g -O0 #-Werror
FLAGS += -DPERF
FLAGS += -DLRU_CACHE
CXXFLAGS += -std=c++0x $(FLAGS)
CFLAGS += -std=c99 -msse4.2 $(FLAGS)
LIBS = -lrdkafka -lboost_regex -levent -lpthread
OBJS = main.o kafkaConsumer.o userAgent.o \
operatingSystem.o bot.o \
browser.o extractor.o enricher.o \
ipLocator.o wrapper.o http.o
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $<
%.o: %.c
$(CC) $(CFLAGS) -c $<
all: mafia #json_test ua_test ip_test
mafia: $(OBJS)
$(CXX) -o $@ $(OBJS) $(LIBS)
# unit test
JSON_OBJS = test_json.o userAgent.o \
operatingSystem.o bot.o \
browser.o extractor.o enricher.o \
ipLocator.o wrapper.o http.o
json_test: $(JSON_OBJS)
$(CXX) -o $@ $(JSON_OBJS) $(LIBS)
UA_OBJS = test_ua.o userAgent.o \
operatingSystem.o bot.o \
browser.o extractor.o enricher.o \
ipLocator.o wrapper.o http.o
ua_test: $(UA_OBJS)
$(CXX) -o $@ $(UA_OBJS) $(LIBS)
IP_OBJS = test_ip.o userAgent.o \
operatingSystem.o bot.o \
browser.o extractor.o enricher.o \
ipLocator.o wrapper.o http.o
ip_test: $(IP_OBJS)
$(CXX) -o $@ $(IP_OBJS) $(LIBS)
.PHONY: clean
clean:
rm -f *.o mafia json_test ua_test ip_test