SUBDIRS = . tests

EXTRA_DIST= $(platform_dist) 

## Generated code

# Note: generated soure and makefiles included in distribution so a
# distribution can be built without code generation tools and XML
# sources.

# This phony target is needed by generated makefile fragments:
force:

# AMQP_XML is defined in ../configure.ac
specs=@AMQP_XML@ $(top_srcdir)/xml/cluster.xml

if GENERATE

# Ruby generator.
rgen_dir=$(top_srcdir)/rubygen
rgen_cmd=ruby -I $(rgen_dir) $(rgen_dir)/generate $(srcdir)/gen $(specs) all $(srcdir)/rubygen.mk

endif				# GENERATE

include $(srcdir)/rubygen.mk

DISTCLEANFILES=rubygen.mk

# Code generated by C++
noinst_PROGRAMS=generate_MethodHolderMaxSize_h
generate_MethodHolderMaxSize_h_SOURCES=gen/generate_MethodHolderMaxSize_h.cpp
qpid/framing/MethodHolderMaxSize.h: generate_MethodHolderMaxSize_h
	./generate_MethodHolderMaxSize_h
BUILT_SOURCES=qpid/framing/MethodHolderMaxSize.h
DISTCLEANFILES+=qpid/framing/MethodHolderMaxSize.h


## Compiler flags

AM_CXXFLAGS = $(WARNING_CFLAGS)
AM_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO_ARG)
INCLUDES = -Igen -I$(srcdir)/gen

## Automake macros to build libraries and executables.

qpidd_LDADD =					\
  libqpidbroker.la				\
  libqpidcommon.la

sbin_PROGRAMS = qpidd
qpidd_SOURCES = qpidd.cpp

posix_plat_src = \
  qpid/sys/epoll/EpollPoller.cpp \
  qpid/sys/posix/Socket.cpp \
  qpid/sys/posix/AsynchIO.cpp \
  qpid/sys/posix/Time.cpp \
  qpid/sys/posix/Thread.cpp \
  qpid/sys/posix/Shlib.cpp

posix_plat_hdr = \
  qpid/sys/posix/check.h \
  qpid/sys/posix/Condition.h \
  qpid/sys/posix/PrivatePosix.h \
  qpid/sys/posix/Mutex.h \
  qpid/sys/posix/Thread.h

platform_src = $(posix_plat_src)
platform_hdr = $(posix_plat_hdr)

lib_LTLIBRARIES = libqpidcommon.la libqpidbroker.la libqpidclient.la

include cluster.mk

# The logger library uses boost::date_time to format time.
# We have to disable the unused parameters warning to get around
# unused parameters in boost::date_time headers. So we build it
# in a convenience library to link into libqpid_common.
# 
noinst_LTLIBRARIES=libLogger.la
libLogger_la_SOURCES=qpid/log/Logger.cpp qpid/log/Logger.h
libLogger_la_CXXFLAGS=$(AM_CXXFLAGS) -Wno-unused-parameter

libqpidcommon_la_LIBADD = \
  -lboost_program_options \
  -luuid \
  libLogger.la \
  $(LIB_DLOPEN) \
  $(LIB_CLOCK_GETTIME)

libqpidcommon_la_SOURCES = \
  $(rgen_common_cpp) \
  $(platform_src) \
  qpid/framing/AccumulatedAck.cpp \
  qpid/framing/AMQBody.cpp \
  qpid/framing/AMQMethodBody.cpp \
  qpid/framing/AMQContentBody.cpp \
  qpid/framing/AMQFrame.cpp \
  qpid/framing/AMQHeaderBody.cpp \
  qpid/framing/AMQHeartbeatBody.cpp \
  qpid/framing/Array.cpp \
  qpid/framing/BasicHeaderProperties.cpp \
  qpid/framing/BodyHandler.cpp \
  qpid/framing/ChannelAdapter.cpp \
  qpid/framing/Buffer.cpp \
  qpid/framing/FieldTable.cpp \
  qpid/framing/FieldValue.cpp \
  qpid/framing/FramingContent.cpp \
  qpid/framing/FrameSet.cpp \
  qpid/framing/InitiationHandler.cpp \
  qpid/framing/ProtocolInitiation.cpp \
  qpid/framing/ProtocolVersion.cpp \
  qpid/framing/SessionState.cpp qpid/framing/SessionState.h \
  qpid/framing/SendContent.cpp \
  qpid/framing/SequenceNumber.cpp \
  qpid/framing/SequenceNumberSet.cpp \
  qpid/framing/Proxy.cpp \
  qpid/framing/Uuid.cpp \
  qpid/framing/AMQP_HighestVersion.h \
  qpid/framing/Blob.cpp \
  qpid/framing/MethodHolder.cpp \
  qpid/framing/MethodHolderMaxSize.h \
  qpid/framing/TransferContent.cpp \
  qpid/assert.cpp qpid/assert.h \
  qpid/Exception.cpp \
  qpid/Plugin.cpp \
  qpid/Url.cpp \
  qpid/sys/AsynchIOAcceptor.cpp \
  qpid/sys/Dispatcher.cpp \
  qpid/sys/Runnable.cpp \
  qpid/sys/SystemInfo.cpp \
  qpid/sys/Serializer.cpp \
  qpid/sys/Shlib.cpp \
  qpid/Options.cpp \
  qpid/log/Options.cpp \
  qpid/log/Selector.cpp \
  qpid/log/Statement.cpp

libqpidbroker_la_LIBADD = libqpidcommon.la -lboost_iostreams
libqpidbroker_la_SOURCES = \
  qpid/broker/Broker.cpp \
  qpid/broker/BrokerAdapter.cpp \
  qpid/broker/BrokerSingleton.cpp \
  qpid/broker/Exchange.cpp \
  qpid/broker/Queue.cpp \
  qpid/broker/PersistableMessage.cpp \
  qpid/broker/Connection.cpp \
  qpid/broker/ConnectionHandler.cpp \
  qpid/broker/ConnectionFactory.cpp \
  qpid/broker/Daemon.cpp \
  qpid/broker/DeliverableMessage.cpp \
  qpid/broker/DeliveryRecord.cpp \
  qpid/broker/DirectExchange.cpp \
  qpid/broker/DtxAck.cpp \
  qpid/broker/DtxBuffer.cpp \
  qpid/broker/DtxHandlerImpl.cpp \
  qpid/broker/DtxManager.cpp \
  qpid/broker/DtxTimeout.cpp \
  qpid/broker/DtxWorkRecord.cpp \
  qpid/broker/ExchangeRegistry.cpp \
  qpid/broker/FanOutExchange.cpp \
  qpid/broker/HeadersExchange.cpp \
  qpid/broker/IncomingExecutionContext.cpp \
  qpid/broker/management/ManagementAgent.cpp \
  qpid/broker/management/ManagementExchange.cpp \
  qpid/broker/management/ManagementObject.cpp \
  qpid/broker/management/ManagementObjectBroker.cpp \
  qpid/broker/management/ManagementObjectQueue.cpp \
  qpid/broker/management/ManagementObjectVhost.cpp \
  qpid/broker/Message.cpp \
  qpid/broker/MessageAdapter.cpp \
  qpid/broker/MessageBuilder.cpp \
  qpid/broker/MessageDelivery.cpp \
  qpid/broker/MessageHandlerImpl.cpp \
  qpid/broker/MessageStoreModule.cpp \
  qpid/broker/NameGenerator.cpp \
  qpid/broker/NullMessageStore.cpp \
  qpid/broker/QueueBindings.cpp \
  qpid/broker/QueuePolicy.cpp \
  qpid/broker/QueueRegistry.cpp \
  qpid/broker/RecoveryManagerImpl.cpp \
  qpid/broker/RecoveredEnqueue.cpp \
  qpid/broker/RecoveredDequeue.cpp \
  qpid/broker/SemanticState.h \
  qpid/broker/SemanticState.cpp \
  qpid/broker/SessionState.h \
  qpid/broker/SessionState.cpp \
  qpid/broker/SessionManager.h \
  qpid/broker/SessionManager.cpp \
  qpid/broker/SessionHandler.h \
  qpid/broker/SessionHandler.cpp \
  qpid/broker/SemanticHandler.cpp \
  qpid/broker/Timer.cpp \
  qpid/broker/TopicExchange.cpp \
  qpid/broker/TxAck.cpp \
  qpid/broker/TxBuffer.cpp \
  qpid/broker/TxPublish.cpp 

libqpidclient_la_LIBADD = libqpidcommon.la
libqpidclient_la_SOURCES =			\
  $(rgen_client_cpp)				\
  qpid/client/Session.h				\
  qpid/client/Connection.cpp			\
  qpid/client/Channel.cpp			\
  qpid/client/Exchange.cpp			\
  qpid/broker/PersistableMessage.cpp		\
  qpid/client/Queue.cpp				\
  qpid/client/ConnectionImpl.cpp		\
  qpid/client/Connector.cpp			\
  qpid/client/Demux.cpp				\
  qpid/client/Dispatcher.cpp			\
  qpid/client/LocalQueue.cpp			\
  qpid/client/MessageListener.cpp		\
  qpid/client/Correlator.cpp			\
  qpid/client/CompletionTracker.cpp		\
  qpid/client/ConnectionHandler.cpp		\
  qpid/client/ExecutionHandler.cpp		\
  qpid/client/FutureCompletion.cpp		\
  qpid/client/FutureResponse.cpp		\
  qpid/client/FutureResult.cpp			\
  qpid/client/SessionCore.cpp			\
  qpid/client/StateManager.cpp			\
  qpid/client/SubscriptionManager.cpp

nobase_include_HEADERS = \
  $(platform_hdr) \
  qpid/assert.h \
  qpid/Exception.h \
  qpid/ExceptionHolder.h \
  qpid/Msg.h \
  qpid/Options.h \
  qpid/Plugin.h \
  qpid/RefCounted.h \
  qpid/SharedObject.h \
  qpid/Url.h \
  qpid/memory.h \
  qpid/shared_ptr.h \
  qpid/broker/Broker.h \
  qpid/broker/BrokerAdapter.h \
  qpid/broker/Exchange.h \
  qpid/broker/Queue.h \
  qpid/broker/BrokerSingleton.h \
  qpid/broker/Connection.h \
  qpid/broker/ConnectionFactory.h \
  qpid/broker/ConnectionHandler.h \
  qpid/broker/ConnectionToken.h \
  qpid/broker/Consumer.h \
  qpid/broker/Daemon.h \
  qpid/broker/Deliverable.h \
  qpid/broker/DeliverableMessage.h \
  qpid/broker/DeliveryAdapter.h \
  qpid/broker/DeliveryId.h \
  qpid/broker/DeliveryRecord.h \
  qpid/broker/DeliveryToken.h \
  qpid/broker/DirectExchange.h \
  qpid/broker/DtxAck.h \
  qpid/broker/DtxBuffer.h \
  qpid/broker/DtxHandlerImpl.h \
  qpid/broker/DtxManager.h \
  qpid/broker/DtxTimeout.h \
  qpid/broker/DtxWorkRecord.h \
  qpid/broker/ExchangeRegistry.h \
  qpid/broker/FanOutExchange.h \
  qpid/broker/HandlerImpl.h \
  qpid/broker/HeadersExchange.h \
  qpid/broker/IncomingExecutionContext.h \
  qpid/broker/management/ManagementAgent.h \
  qpid/broker/management/ManagementExchange.h \
  qpid/broker/management/ManagementObject.h \
  qpid/broker/management/ManagementObjectBroker.h \
  qpid/broker/management/ManagementObjectQueue.h \
  qpid/broker/management/ManagementObjectVhost.h \
  qpid/broker/Message.h \
  qpid/broker/MessageAdapter.h \
  qpid/broker/MessageBuilder.h \
  qpid/broker/MessageDelivery.h \
  qpid/broker/MessageHandlerImpl.h \
  qpid/broker/MessageStore.h \
  qpid/broker/MessageStoreModule.h \
  qpid/broker/NameGenerator.h \
  qpid/broker/NullMessageStore.h \
  qpid/broker/Persistable.h \
  qpid/broker/PersistableExchange.h \
  qpid/broker/PersistableMessage.h \
  qpid/broker/PersistableQueue.h \
  qpid/broker/Prefetch.h \
  qpid/broker/QueueBindings.h \
  qpid/broker/QueuePolicy.h \
  qpid/broker/QueueRegistry.h \
  qpid/broker/RecoverableExchange.h \
  qpid/broker/RecoverableMessage.h \
  qpid/broker/RecoverableQueue.h \
  qpid/broker/RecoverableTransaction.h \
  qpid/broker/RecoveredDequeue.h \
  qpid/broker/RecoveredEnqueue.h \
  qpid/broker/RecoveryManager.h \
  qpid/broker/RecoveryManagerImpl.h \
  qpid/broker/SemanticHandler.h \
  qpid/broker/Timer.h \
  qpid/broker/TopicExchange.h \
  qpid/broker/TransactionalStore.h \
  qpid/broker/TxAck.h \
  qpid/broker/TxBuffer.h \
  qpid/broker/TxOp.h \
  qpid/broker/TxPublish.h \
  qpid/client/AckMode.h \
  qpid/client/ChainableFrameHandler.h	\
  qpid/client/Channel.h \
  qpid/client/Exchange.h \
  qpid/client/Message.h \
  qpid/client/Queue.h \
  qpid/client/AckPolicy.h			\
  qpid/client/Completion.h \
  qpid/client/CompletionTracker.h \
  qpid/client/Connection.h \
  qpid/client/ConnectionHandler.h \
  qpid/client/ConnectionImpl.h \
  qpid/client/Connector.h \
  qpid/client/Correlator.h \
  qpid/client/Demux.h \
  qpid/client/Dispatcher.h \
  qpid/client/LocalQueue.h \
  qpid/client/Execution.h \
  qpid/client/ExecutionHandler.h \
  qpid/client/Future.h \
  qpid/client/FutureCompletion.h \
  qpid/client/FutureResponse.h \
  qpid/client/FutureResult.h \
  qpid/client/MessageListener.h \
  qpid/client/MessageQueue.h \
  qpid/client/Response.h \
  qpid/client/SessionCore.h \
  qpid/client/StateManager.h \
  qpid/client/SubscriptionManager.h \
  qpid/client/TypedResult.h \
  qpid/framing/AMQBody.h \
  qpid/framing/AMQContentBody.h \
  qpid/framing/AMQDataBlock.h \
  qpid/framing/AMQFrame.h \
  qpid/framing/AMQHeaderBody.h \
  qpid/framing/AMQHeartbeatBody.h \
  qpid/framing/AMQMethodBody.h \
  qpid/framing/AMQP_HighestVersion.h \
  qpid/framing/AccumulatedAck.h \
  qpid/framing/Array.h \
  qpid/framing/BasicHeaderProperties.h \
  qpid/framing/Blob.h \
  qpid/framing/BodyHandler.h \
  qpid/framing/Buffer.h \
  qpid/framing/ChannelHandler.h \
  qpid/framing/ChannelAdapter.h \
  qpid/framing/FieldTable.h \
  qpid/framing/FieldValue.h \
  qpid/framing/FrameDefaultVisitor.h \
  qpid/framing/FrameHandler.h \
  qpid/framing/FrameHandler.h \
  qpid/framing/FrameSet.h \
  qpid/framing/FramingContent.h \
  qpid/framing/Handler.h \
  qpid/framing/HandlerUpdater.h \
  qpid/framing/HeaderProperties.h \
  qpid/framing/InitiationHandler.h \
  qpid/framing/Invoker.h \
  qpid/framing/InputHandler.h \
  qpid/framing/MethodContent.h \
  qpid/framing/MethodHolder.h \
  qpid/framing/MethodHolderMaxSize.h \
  qpid/framing/ModelMethod.h \
  qpid/framing/OutputHandler.h \
  qpid/framing/ProtocolInitiation.h \
  qpid/framing/ProtocolVersion.h \
  qpid/framing/Proxy.h \
  qpid/framing/SendContent.h \
  qpid/framing/SequenceNumber.h \
  qpid/framing/SequenceNumberSet.h \
  qpid/framing/SerializeHandler.h \
  qpid/framing/StructHelper.h \
  qpid/framing/TransferContent.h \
  qpid/framing/TypeFilter.h \
  qpid/framing/Uuid.h \
  qpid/framing/Visitor.h \
  qpid/framing/amqp_framing.h \
  qpid/framing/amqp_types.h \
  qpid/framing/amqp_types_full.h \
  qpid/framing/frame_functors.h \
  qpid/framing/variant.h \
  qpid/log/Helpers.h \
  qpid/log/Options.h \
  qpid/log/Selector.h \
  qpid/log/Statement.h \
  qpid/sys/Acceptor.h \
  qpid/sys/AsynchIO.h \
  qpid/sys/AtomicCount.h \
  qpid/sys/BlockingQueue.h \
  qpid/sys/Condition.h \
  qpid/sys/ConnectionInputHandler.h \
  qpid/sys/ConnectionInputHandlerFactory.h \
  qpid/sys/ConnectionOutputHandler.h \
  qpid/sys/Dispatcher.h \
  qpid/sys/Module.h \
  qpid/sys/Monitor.h \
  qpid/sys/Mutex.h \
  qpid/sys/Poller.h \
  qpid/sys/Runnable.h \
  qpid/sys/RefCountedMap.h \
  qpid/sys/ScopedIncrement.h \
  qpid/sys/Semaphore.h \
  qpid/sys/Serializer.h \
  qpid/sys/SystemInfo.h \
  qpid/sys/Shlib.h \
  qpid/sys/ShutdownHandler.h \
  qpid/sys/Socket.h \
  qpid/sys/StateMonitor.h \
  qpid/sys/Waitable.h \
  qpid/sys/Thread.h \
  qpid/sys/Time.h \
  qpid/sys/TimeoutHandler.h

# Force build of qpidd during dist phase so help2man will work.
dist-hook: $(BUILT_SOURCES)
	$(MAKE) qpidd

