summaryrefslogtreecommitdiff
path: root/cpp/examples
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/examples')
-rw-r--r--cpp/examples/Makefile.am22
1 files changed, 13 insertions, 9 deletions
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