Add debug/profiler options to makefile

This commit is contained in:
Pavel Odintsov 2013-11-14 14:56:08 +04:00
parent 69e5a25b73
commit d6e1a92cc4
2 changed files with 20 additions and 3 deletions

View File

@ -1,10 +1,23 @@
all: fastnetmon
# User parameters
ENGINE = ULOG2
#ENGINE = PCAP
REDIS_SUPPORT = yes
# Develoepr parameters
ENABLE_DEBUG = no
ENABLE_PROFILER = no
# Code
ifeq ($(BUILD_FLAGS), yes)
BUILD_FLAGS += -g
endif
ifeq ($(ENABLE_PROFILER), yes)
BUILD_FLAGS += -pg
endif
# we use C++ 11 threads. We must include pthread library due gcc bug
LIBS += -lpthread
@ -20,10 +33,10 @@ ifeq ($(ENGINE), PCAP)
endif
fastnetmon: libipulog.o fastnetmon.o
g++ libipulog.o fastnetmon.o -o fastnetmon $(LIBS)
g++ libipulog.o fastnetmon.o -o fastnetmon $(LIBS) -g $(BUILD_FLAGS)
libipulog.o: libipulog.c
g++ -c libipulog.c -o libipulog.o -Wno-write-strings
fastnetmon.o: fastnetmon.cpp
g++ $(DEFINES) -c fastnetmon.cpp -o fastnetmon.o -std=c++11
g++ $(DEFINES) -c fastnetmon.cpp -o fastnetmon.o -std=c++11 $(BUILD_FLAGS)
clean:
rm -f libipulog.o fastnetmon.o fastnetmon

View File

@ -4,6 +4,9 @@
2) Подумать на тему выноса всех параметров в конфиг
3) Перенести список бана в структуру черного списка
4) Перейти на cap_admin при работе от штатного юзера
5) Оптимизировать belongs_to_network на префиксном дереве
6) Не создавайте больших списков айпи сетей! Будет тормозить!
*/
/* Author: pavel.odintsov@gmail.com */
@ -29,6 +32,7 @@
#include <algorithm>
#include <iostream>
#include <map>
//#include <unordered_map>
#include <vector>
#include <utility>
#include <sstream>