From a76aa420daf20d4f575d88182ef9cfec87bdb51b Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 9 Nov 2007 03:32:43 +0000 Subject: Makefile to build/distribute examples. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@593415 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/examples/Makefile.am | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'cpp') diff --git a/cpp/examples/Makefile.am b/cpp/examples/Makefile.am index 955411ab98..3836665c35 100644 --- a/cpp/examples/Makefile.am +++ b/cpp/examples/Makefile.am @@ -1,14 +1,18 @@ -noinst_PROGRAMS=create_queue topic_listener topic_publisher -INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/src/gen -I$(top_builddir)src/gen -lib_client = $(top_builddir)/src/libqpidclient.la +# Note: we don't use normal automake SUBDIRS because the example +# makefiles are don't understand all automake targets. +EXAMPLE_DIRS=direct fanout pub-sub request-response +src=../$(top_srcdir)/src +bld=../$(top_builddir)/src +EXAMPLE_FLAGS=-I$(src) -I$(src)/gen -I$(bld)/gen -L$(bld)/.libs -create_queue_LDADD=$(lib_client) -create_queue_SOURCES=create_queue.cpp +all: + for d in $(EXAMPLE_DIRS); do ( cd $$d; make CXX="$(CXX)" CXXFLAGS="$(EXAMPLE_FLAGS)" $@; ) ; done -topic_listener_LDADD=$(lib_client) -topic_listener_SOURCES=topic_listener.cpp +clean: + for d in $(EXAMPLE_DIRS); do ( cd $$d; make $@; ) ; done + +dist-hook: clean + cp --parents `find $(EXAMPLE_DIRS) -name Makefile -o -name '*.cpp'` $(distdir) -topic_publisher_LDADD=$(lib_client) -topic_publisher_SOURCES=topic_publisher.cpp -- cgit v1.2.1