ARTSPPINC = -I@artspp@/include
CFDINC    = -I../include -I../../include
SNMPPINC  = -I../../snmp++/classes/include
OBJECTS   = CflowdAsMatrix.lo \
	    CflowdNetMatrix.lo \
	    CflowdPortMatrix.lo \
	    CflowdProtocolTable.lo \
	    CflowdCisco.lo \
	    CflowdCiscoFlowEngine.lo \
	    CflowdRawFlow.lo \
	    CflowdRawFlowConverter.lo \
	    CflowdConfig.lo \
	    Signal.lo \
	    CflowdCiscoMap.lo \
	    CflowdCollector.lo \
	    CflowdCollectorMap.lo \
	    lex.yy.lo \
	    CflowdFlowPortList.lo \
	    CflowdTableRequest.lo \
	    CflowdInterfaceInfo.lo \
	    CflowdInterfaceMatrix.lo \
	    CflowdNextHopTable.lo \
	    CflowdPacketQueue.lo \
	    CflowdRawFlowLogger.lo \
	    CflowdTosTable.lo \
	    CflowdVersion.lo \
	    FlowFilterLex.lo \
	    CflowdFlowFilter.lo \
	    flowfilt.tab.lo \
	    filtexpr.lo
HDRFILES  = ../include/CflowdAsMatrix.hh \
	    ../include/CflowdAsMatrixKey.hh \
	    ../include/CflowdAsMatrixTrafficCounter.hh \
	    ../include/CflowdCisco.hh \
	    ../include/CflowdCiscoFlowEngine.hh \
	    ../include/CflowdCiscoFlowEngineMap.hh \
	    ../include/CflowdCiscoFlowInterface.hh \
	    ../include/CflowdCiscoFlowInterfaceMap.hh \
	    ../include/CflowdCiscoMap.hh \
	    ../include/CflowdCollector.hh \
	    ../include/CflowdCollectorMap.hh \
	    ../include/CflowdConfig.hh \
	    ../include/CflowdConfigLex.hh \
	    ../include/CflowdFlowFilter.hh \
	    ../include/CflowdFlowPdu.h \
	    ../include/CflowdFlowPortList.hh \
	    ../include/CflowdInterfaceInfo.hh \
	    ../include/CflowdInterfaceMatrix.hh \
	    ../include/CflowdInterfaceMatrixKey.hh \
	    ../include/CflowdInterfaceMatrixTrafficCounter.hh \
	    ../include/CflowdNetMatrix.hh \
	    ../include/CflowdNetMatrixKey.hh \
	    ../include/CflowdNetMatrixTrafficCounter.hh \
	    ../include/CflowdNextHopTable.hh \
	    ../include/CflowdNextHopTableTrafficCounter.hh \
	    ../include/CflowdPacketQueue.hh \
	    ../include/CflowdPortMatrix.hh \
	    ../include/CflowdPortMatrixKey.hh \
	    ../include/CflowdPortMatrixTrafficCounter.hh \
	    ../include/CflowdProtocolTable.hh \
	    ../include/CflowdProtocolTableTrafficCounter.hh \
	    ../include/CflowdRawFlow.hh \
	    ../include/CflowdRawFlowConverter.hh \
	    ../include/CflowdRawFlowLogger.hh \
	    ../include/CflowdTableRequest.hh \
	    ../include/CflowdTosTable.hh \
	    ../include/CflowdUint16Uint16Key.hh \
	    ../include/CflowdUint64TrafficCounter.hh \
	    ../include/CflowdVersion.hh
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
top_builddir = ../..
LIBTOOL = @ /bin/sh $(top_builddir)/libtool

.SUFFIXES: .cc .c .o .lo .a

all: ../lib/libCfd.la

../lib/libCfd.la: ${OBJECTS}
	${LIBTOOL} ${CXX} -o ../lib/libCfd.la ${OBJECTS} -rpath @libdir@ -versiob-info ${C_R_A}

.cc.o:
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} -c $<

.cc.lo:
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} -c $<

CflowdCisco.lo: CflowdCisco.cc ../include/CflowdCisco.hh
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} ${SNMPPINC} \
	 -c CflowdCisco.cc

CflowdCiscoMap.lo: CflowdCiscoMap.cc ../include/*.hh \
		  @artspp@/include/caida_t.h @artspp@/include/ArtsPrimitive.hh
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} ${SNMPPINC} \
	 -c CflowdCiscoMap.cc

CflowdInterfaceInfo.lo: CflowdInterfaceInfo.cc \
		       ../include/CflowdInterfaceInfo.hh \
		       @artspp@/include/caida_t.h
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} ${SNMPPINC} \
	 -c CflowdInterfaceInfo.cc

CflowdConfig.lo: CflowdConfig.cc ../include/*.hh @artspp@/include/caida_t.h \
		@artspp@/include/ArtsPrimitive.hh
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} ${SNMPPINC} \
	 -c CflowdConfig.cc

CflowdTableRequest.lo: CflowdTableRequest.cc ../include/*.hh \
		      @artspp@/include/caida_t.h \
		      @artspp@/include/ArtsPrimitive.hh
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} ${SNMPPINC} \
	 -c CflowdTableRequest.cc

FlowFilterLex.lo: FlowFilterLex.cc flowfilt.tab.h
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} -c FlowFilterLex.cc

flowfilt.tab.lo: flowfilt.tab.c
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} -c flowfilt.tab.c

flowfilt.tab.c: FlowFilter.y
	bison -d -b flowfilt -p flowfilt FlowFilter.y

flowfilt.tab.h: FlowFilter.y
	bison -d -b flowfilt -p flowfilt FlowFilter.y

lex.yy.lo: lex.yy.cc
	${LIBTOOL} ${CXX} ${CFDINC} ${ARTSPPINC} ${SNMPPINC} @FLEXINC@ -c lex.yy.cc

lex.yy.cc: config.lex
	flex -+ config.lex

filtexpr.lo: filtexpr.cc
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${CFDINC} ${ARTSPPINC} @FLEXINC@ -c filtexpr.cc

filtexpr.cc: filtexpr.lex
	flex -Pfiltexpr -ofiltexpr.cc filtexpr.lex

install: ../lib/libCfd.la
	${LIBTOOL} ../../install-sh -c -m 444 ../lib/libCfd.la @libdir@/libCfd.la
	for header in ${HDRFILES}; do \
	  ../../install-sh -c -m 444 $$header @includedir@/ ; \
	done

tarball::
	if [ -f @libdir@/libCfd.a ]; then \
	  @TAR@ -rvf ../../@PKG_VERSION@_@OSNAME@.tar @libdir@/libCfd.a ; \
	fi
	if [ -f @libdir@/libCfd.la ]; then \
	  . @libdir@/libCfd.la ; \
	  for libfile in $$library_names ; do \
	    @TAR@ -uvf ../../@PKG_VERSION@_@OSNAME@.tar @libdir@/$$libfile ; \
	  done ; \
	fi

clean::
	rm -f ../lib/libCfd.la *.lo *.o lex.yy.cc filtexpr.cc flowfilt.tab.c
	rm -Rf .libs ../lib/.libs flowfilt.tab.h


