# $Id: Makefile,v 1.88 2001/06/29 05:36:28 bko Exp $

BUILD = ../build

include $(BUILD)/Makefile.pre

DEFINES += USE_PTHREADS

TARGET_LIBRARY = libutil.a

ifeq ($(USE_YARROW),1)
PACKAGES += LIBCEXT PTHREAD LIBXML YARROW OPENSSL
else
PACKAGES += LIBCEXT PTHREAD LIBXML
endif

ifeq ($(USE_BIND),1)
PACKAGES += BIND 
endif


INCDIRS += $(UTIL_INCLUDEDIRS)

# CXXFLAGS += --pedantic

# names of programs (e.g. test programs) to be compiled
#TESTPROGRAMS = \
#	Datatest.cxx \
#	VTest.cxx

ifeq ($(OSTYPE),Linux)
DEFINES += USE_CRYPTO_RANDOM
endif
 
CODE_SUBDIRS =  threads logging crypto statistics snmp signals behavior io \
                services transport config dnssrv

#	NewData.cxx \

# name of all files to be compiled (don't include header files)

#	CopyOnWriteData.cxx

SRC = \
        VocalCommon.cxx \
        Application.cxx \
        Runnable.cxx \
        Garbage.cxx \
        GarbageCan.cxx \
        SystemException.cxx \
        SystemStatus.cxx \
        MemoryManager.cxx \
	Verify.cxx \
        VTest.cxx \
        Base64.cxx \
	FileDataStore.cxx \
	DataStore.cxx \
	Sptr.cxx \
	Data.cxx \
	StringData.cxx \
	DataException.cxx \
	VException.cxx \
	debug.cxx \
	support.cxx \
	Timer.cxx \
	VTime.cxx \
	mstring.cxx \
	VFilter.cxx \
	Daemon.cxx \
	HostMatch.cxx \
	VEnvVar.cxx \
        CryptoRandom.cxx \
	TimeVal.cxx\
        threads/AssertSingleThreaded.cxx \
        threads/Condition.cxx \
        threads/Lock.cxx \
        threads/Lockable.cxx \
        threads/Mutex.cxx \
        threads/RWMutex.cxx \
        threads/Thread.cxx \
        threads/ThreadIf.cxx \
	threads/VSemaphore.cxx \
        threads/VThreadEvent.cxx \
        threads/VThreadException.cxx \
        threads/VThreadGate.cxx \
        threads/VThreadPool.cxx \
        threads/vthread-linux.cxx \
        threads/vthread-vxworks.cxx \
        logging/cpLog.cxx \
        logging/Log.cxx \
        logging/PriorityLog.cxx \
        logging/CpPriorityLog.cxx \
        logging/VLog.cxx \
        crypto/vmd5.c \
        crypto/digest.cxx \
        statistics/Statistic.cxx \
        statistics/TotalStatistic.cxx \
        statistics/StatisticsDb.cxx \
        statistics/PerfTotal.cxx \
	snmp/AgentApi.cxx \
	snmp/AgentRegister.cxx \
	signals/SignalSet.cxx \
	signals/SignalAction.cxx \
        behavior/Action.cxx \
        behavior/Context.cxx \
        behavior/Observer.cxx \
        behavior/StateInterface.cxx \
        behavior/Stimulus.cxx \
        behavior/Subject.cxx \
        io/FileDescriptor.cxx \
        io/Pipe.cxx \
        io/VFile.cxx \
        io/Writer.cxx \
        services/ControlEvent.cxx \
        services/Event.cxx \
        services/FifoService.cxx \
        services/PollFifoService.cxx \
        services/Service.cxx \
        services/ServiceManager.cxx \
        services/ProtocolService.cxx \
        services/ServiceApplication.cxx \
        transport/AddressFamily.cxx \
        transport/Connection.cxx \
        transport/ConnectionBrokenException.cxx \
        transport/DatagramSocket.cxx \
        transport/IP6Address.cxx \
        transport/IPAddress.cxx \
        transport/MACAddress.cxx \
        transport/NetworkAddress.cxx \
        transport/Poll.cxx \
        transport/Protocol.cxx \
        transport/ProtocolException.cxx \
        transport/ProtocolFactory.cxx \
        transport/Socket.cxx \
        transport/SocketOptions.cxx \
        transport/SocketType.cxx \
        transport/StreamClientSocket.cxx \
        transport/StreamServerSocket.cxx \
        transport/TCPClientSocket.cxx \
        transport/TCPServerProtocol.cxx \
        transport/TCPServerSocket.cxx \
        transport/TPKTClientProtocol.cxx \
        transport/TPKTClientSocket.cxx \
        transport/TPKTServerProtocol.cxx \
        transport/TPKTServerSocket.cxx \
        transport/Tcp_ClientSocket.cxx \
        transport/Tcp_ServerSocket.cxx \
        transport/TransportAddress.cxx \
        transport/UDPSocket.cxx \
        transport/UdpStack.cxx \
        transport/vsock.cxx \
	config/parse3tuple.cxx \
	config/CommandLine.cxx \
        config/GetOpt.cxx \
        config/ParsePair.cxx \
        config/Config.cxx \
	CWBuffer.cxx\
	crypto/Md5.cxx

ifeq ($(USE_YARROW),1)
SRC += 	\
        YarrowPseudoRandom.cxx
endif

ifeq ($(OSTYPE),cygwin)
else
SRC +=  \
        io/VNamedPipeFC.cxx \
	VXmlParser.cxx\
        Random.cxx \
        statistics/TickCount.cxx \
        statistics/DurationStatistic.cxx \
        statistics/PerformanceDb.cxx \
        statistics/PerfDuration.cxx \
        signals/SignalHandler.cxx \
        io/VFileBrowser.cxx \
        io/VFileSystem.cxx \

endif

ifeq ($(USE_BIND),1)
SRC += 	\
        dnssrv/DnsRecord.cxx \
        dnssrv/DnsResolver.cxx
endif

include $(BUILD)/Makefile.post
