#/*************************************************************************
#***	Authentication, authorization, accounting + firewalling package
#***	(c) 1998-2002 Anton Vinokurov <anton@netams.com>
#***	(c) 2002-2005 NeTAMS Development Team
#***	All rights reserved. See 'Copying' file included in distribution
#***	For latest version and more info, visit this project web page
#***	located at http://www.netams.com
#***		 					
#*************************************************************************/
# This is automatically generated Makefile for NeTAMS
# Created Sat Apr  9 20:02:26 MSD 2005
# Run 'make -f Makefile.run' to compile
DEFINE = -DLINUX -D_BSD_SOURCE -I/usr/include/pcap -I/usr/libipq
LIB = -pthread -lpcap -lcrypt -lipq
INSTALL = /usr/bin/install
PATH_TO_ETC=/etc
PATH_TO_CONFIG=/etc/netams/netams.conf
PATH_TO_LOG=/var/log/netams/netams.log
PATH_TO_SCRIPTS=/etc/init.d
DAEMONDIR=/usr/sbin
SBINDIR=/usr/sbin
MANDIR=/usr/man
DEFINE += -DUSE_MYSQL -I/usr/include/mysql
LIB += -lmysqlclient -L/usr/lib
DEFINE += -DUSE_POSTGRES -I/usr/include/pgsql
LIB += -lpq -L/usr/lib
DEFINE += -DHAVE_BILLING
SRC += billing.c s_billing.c
HEADERFILES += billing.h
DEFINE += -DDEBUG
FLAGS += -g -Wall
#
#
############################################################
# Common part of Makefile for NeTAMS project
# $Id: Makefile.common,v 1.14.4.2 2005/02/18 18:04:02 anton Exp $
#
PROG += netams
SRC += main.c common.c versions.c connections.c parse.c security.c services.c \
 s_server.c users.c net_units.c s_processor.c messages_fifo.c s_datasource.c \
 policy.c s_storage.c st_hash.c st_sql.c p_prefix.c alert_report.c s_scheduler.c \
 ds_netflow.c s_html.c s_monitor.c s_quotactl.c s_quota.c s_weblogin.c s_pvmgate.c \
 st_sql_mysql.c st_sql_oracle.c st_sql_postgres.c ds_mailstat.c iptree.c \
 s_login.c flow.c ds_ipq.c ds_libpcap.c ds_ipfw.c memory.c events.c html.c \
 lib.c bw.c libipulog.c ds_ulog.c

HEADERFILES += netams.h connections.h common.h security.h services.h users.h iptree.h\
 net_units.h messages_fifo.h policy.h st_any.h policy_prefix.h alert_report.h  flow.h\
 memory.h lib.h config.h bw.h libipulog.h versions.sh versions_build.dat

CC	= g++
FLAGS  += -pipe -O2
DEFINE += -D_REENTRANT -D_THREAD_SAFE
INCLUDE=/usr/local/include
OBJ	= $(SRC:.c=.o)
CFLAGS	= $(FLAGS) -I$(INCLUDE) $(DEFINE)

all: 
	cd src && make $(PROG)

distclean: clean
	cp addon/Makefile.boot Makefile ; rm -rf *.[0-9] ; 

clean:
	cd src && rm -rf $(OBJ) $(PROG) netamsctl flowprobe netamsctl.o flowprobe.o \
	versions_build.o core *.core ipfw2netflow.o ipfw2netflow ulog2netflow.o ulog2netflow netflow.o
