CFDINCLUDES = -I../../include -I../../classes/include
CFDLIB      = ../../classes/lib/libCfd.la
ARTSCLASSINC  = -I@artspp@/include
ARTSCLASSLIB  = -L@artspp@/lib -lArts
SNMPPINC      = -I../../snmp++/classes/include
SNMPPPLIB     = ../../snmp++/classes/lib/libsnmp++.la
OBJECTS       = cfdcollect.o config.o CflowdServer.o CfdcollectConfig.o
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
top_builddir = ../..
LIBTOOL = @ /bin/sh $(top_builddir)/libtool

cfdcollect: ${OBJECTS} ${CFDLIB}
	${LIBTOOL} ${CXX} ${CXXFLAGS} ${OBJECTS} ${CFDLIB} ${ARTSCLASSLIB} \
	  ${SNMPPPLIB} @FLEXLIB@ @LIBS@ -o cfdcollect -rpath @artspp@/lib

cfdcollect.o: cfdcollect.cc
	${CXX} ${CXXFLAGS} -c cfdcollect.cc ${CFDINCLUDES} ${ARTSCLASSINC} \
	 ${SNMPPINC}

config.o: config.cc
	${CXX} ${CXXFLAGS} -c config.cc -I. ${CFDINCLUDES} ${ARTSCLASSINC} \
	  @FLEXINC@

config.cc: config.lex
	flex -+ -PyyConfig -oconfig.cc config.lex

CflowdServer.o: CflowdServer.cc CflowdServer.hh
	${CXX} ${CXXFLAGS} -c CflowdServer.cc ${CFDINCLUDES} ${ARTSCLASSINC} \
	  ${SNMPPINC} -I.

CfdcollectConfig.o: CfdcollectConfig.cc CfdcollectConfig.hh
	${CXX} ${CXXFLAGS} -c CfdcollectConfig.cc ${CFDINCLUDES} \
	  ${ARTSCLASSINC} -I.

strip: cfdcollect
	@ -if [ -f .libs/cfdcollect ]; then \
	  strip .libs/cfdcollect ; \
	else \
	  strip cfdcollect ; \
	fi

clean:
	rm -f config.cc *.o cfdcollect
	rm -Rf .libs

install:
	${LIBTOOL} ../../install-sh -c -m 555 cfdcollect @sbindir@/cfdcollect

tarball::
	@TAR@ -uvf ../../@PKG_VERSION@_@OSNAME@.tar @sbindir@/cfdcollect



