#
# Makefile for libnids.
#
# Dug Song <dugsong@monkey.org>

srcdir		= @srcdir@
VPATH		= @srcdir@

install_prefix	=
prefix		= @prefix@
exec_prefix	= @exec_prefix@
includedir	= @includedir@
libdir		= @libdir@
mandir		= @mandir@

CC		= @CC@
CFLAGS		= @CFLAGS@ -Wall -DHAVE_ICMPHDR=@ICMPHEADER@ -DHAVE_TCP_STATES=@TCPSTATES@ -DHAVE_BSD_UDPHDR=@HAVE_BSD_UDPHDR@
LDFLAGS		= @LDFLAGS@

PCAPINC		= @PCAPINC@
PCAPLIB		= @PCAPLIB@

LNETINC		= @LNETINC@
LNETLIB		= @LNETLIB@

INCS		= $(PCAPINC) $(LNETINC)
#LIBS		= $(PCAPLIB) $(LNETLIB) @LIBS@
LIBS		= @LIBS@
RANLIB		= @RANLIB@
INSTALL		= @INSTALL@

OBJS		= checksum.o ip_fragment.o ip_options.o killtcp.o \
		  libnids.o scan.o tcp.o util.o allpromisc.o hash.o

.c.o:
	$(CC) -c $(CFLAGS) -I. $(INCS) $<

all: libnids.a

libnids.a: $(OBJS)
	ar -cr $@ $(OBJS)
	$(RANLIB) $@

install: libnids.a
	../mkinstalldirs $(install_prefix)$(libdir)
	../mkinstalldirs $(install_prefix)$(includedir)
	../mkinstalldirs $(install_prefix)$(mandir)/man3
	$(INSTALL) -c -m 644 libnids.a $(install_prefix)$(libdir)
	$(INSTALL) -c -m 644 nids.h $(install_prefix)$(includedir)
	$(INSTALL) -c -m 644 libnids.3 $(install_prefix)$(mandir)/man3

clean:
	rm -f *.o *~ libnids.a

# EOF
