# Generated automatically from Makefile.in by configure.
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}

bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include



DISTDIR =

CC = gcc
CPP = gcc -E
CXX = c++
RANLIB = ranlib
CFLAGS += -I./md5 -g -O2 -I/usr/include/pcap
CFLAGS += -I. -Wall
DEFS = -DHAVE_CONFIG_H

LIBS += -L/usr/local/lib -L/lib -L/usr/lib -Lmd5 

top_builddir = .
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644

CFLAGS += -DDEBUG -Wall -I../include -I../ -I/usr/local/include
LIBOBJS = debug.o interface.o socket.o time.o pcap.o snarf_divert.o
TEST_BINS=interface_test debug_test fixedpoint_test

CXXFLAGS = $(CFLAGS)

TARGET_LIBS= libron.a libronmd.a libdcrypt.a libnewran.a

all:  debug-text.h ${TARGET_LIBS} ${TEST_BINS}

debug-text.h: ../include/debug.h
	./dbparse.pl < ../include/debug.h > debug-text.h

libron.a:  ${LIBOBJS} debug-text.h
	${AR} cru $@ ${LIBOBJS}
	${RANLIB} $@

libronmd.a:
	cd md5 ; make libronmd.a
	cp -f md5/libronmd.a libronmd.a

libnewran.a:
	cd random ; make libnewran.a
	cp -f random/libnewran.a libnewran.a

libdcrypt.a:
	cd dcrypt ; make libdcrypt.a
	cp -f dcrypt/libdcrypt.a libdcrypt.a

interface_test: ${TARGET_LIBS} interface_test.o
	${CC} interface_test.o -o $@ -L. -lron

interface_test.o: ${TARGET_LIBS} interface.c
	${CC} interface.c ${CFLAGS} -D_TEST_INTERFACE_ -c -o $@

debug_test: debug_test.o
	${CC} debug_test.o -o $@

debug_test.o: debug.c
	${CC} debug.c ${CFLAGS} -c -D_TEST_DEBUG_ -o $@

fixedpoint_test.o: ${TARGET_LIBS} fixedpoint_test.C
	${CXX} fixedpoint_test.C ${CFLAGS} -D_TEST_FIXEDPOINT_ -c -o $@

fixedpoint_test: fixedpoint_test.o ../include/fixedpoint.h
	${CXX} fixedpoint_test.o -o $@

clean:
	/bin/rm -f *.a *.o core *.core ${TEST_BINS}
	cd md5 ; make clean
	cd dcrypt ; make clean
	cd random ; make clean

objclean:
	/bin/rm -f *.o core *.core
	cd md5 ; make objclean
	cd dcrypt ; make objclean
	cd random ; make objclean

reallyclean: clean
	/bin/rm -f Makefile
