Port: Fixes to build system for portability
[urcu.git] / doc / examples / Makefile.am
index 74e2666316ab853da9ffd2066f5ca1907150af1b..313f5215b254f908eeab9502f455ef67ef3a41b6 100644 (file)
@@ -1,13 +1,22 @@
 doc_examplesdir = ${docdir}/examples
 
-doc_examples_rcu_flavor_qsbrdir = ${doc_examplesdir}/rcu-flavor-qsbr
-
-dist_doc_examples_rcu_flavor_qsbr_DATA = \
-       rcu-flavor-qsbr/Makefile \
-       rcu-flavor-qsbr/Makefile.rcu-flavor-qsbr \
-       rcu-flavor-qsbr/rcu-flavor-qsbr.c
+doc_examples_urcu_flavorsdir = ${doc_examplesdir}/urcu-flavors
+
+dist_doc_examples_urcu_flavors_DATA = \
+       urcu-flavors/Makefile \
+       urcu-flavors/Makefile.qsbr \
+       urcu-flavors/Makefile.mb \
+       urcu-flavors/Makefile.membarrier \
+       urcu-flavors/Makefile.signal \
+       urcu-flavors/Makefile.bp \
+       urcu-flavors/qsbr.c \
+       urcu-flavors/mb.c \
+       urcu-flavors/membarrier.c \
+       urcu-flavors/signal.c \
+       urcu-flavors/bp.c
 
 dist_doc_examples_DATA = \
+       dist-files/Makefile \
        Makefile.examples.template
 
 doc_examples_listdir = ${doc_examplesdir}/list
@@ -73,19 +82,75 @@ dist_doc_examples_lfstack_DATA = \
        lfstack/cds_lfs_pop_blocking.c \
        lfstack/cds_lfs_pop_all_blocking.c
 
+doc_examples_rculfqueuedir = ${doc_examplesdir}/rculfqueue
+
+dist_doc_examples_rculfqueue_DATA = \
+       rculfqueue/Makefile \
+       rculfqueue/Makefile.cds_lfq_enqueue \
+       rculfqueue/Makefile.cds_lfq_dequeue \
+       rculfqueue/cds_lfq_enqueue.c \
+       rculfqueue/cds_lfq_dequeue.c
+
+doc_examples_rculfhashdir = ${doc_examplesdir}/rculfhash
+
+dist_doc_examples_rculfhash_DATA = \
+       rculfhash/Makefile \
+       rculfhash/jhash.h \
+       rculfhash/Makefile.cds_lfht_add \
+       rculfhash/Makefile.cds_lfht_add_unique \
+       rculfhash/Makefile.cds_lfht_add_replace \
+       rculfhash/Makefile.cds_lfht_del \
+       rculfhash/Makefile.cds_lfht_destroy \
+       rculfhash/Makefile.cds_lfht_lookup \
+       rculfhash/Makefile.cds_lfht_for_each_entry_duplicate \
+       rculfhash/cds_lfht_add.c \
+       rculfhash/cds_lfht_add_unique.c \
+       rculfhash/cds_lfht_add_replace.c \
+       rculfhash/cds_lfht_del.c \
+       rculfhash/cds_lfht_destroy.c \
+       rculfhash/cds_lfht_lookup.c \
+       rculfhash/cds_lfht_for_each_entry_duplicate.c
+
 if NO_SHARED
 # Don't build examples if shared libraries support was explicitly
 # disabled.
 else
-SUBDIRS_PROXY = rcu-flavor-qsbr list hlist wfcqueue wfstack lfstack
 
+SUBDIRS_PROXY = hlist list urcu-flavors wfcqueue rculfqueue \
+       wfstack lfstack rculfhash
+
+# Copies are for VPATH build support.
 all-local:
-       for subdir in $(SUBDIRS_PROXY); do \
-               cd $$subdir && $(MAKE) AM_CPPFLAGS="-I../../../urcu/ -I../../../" AM_LDFLAGS='-L../../../.libs/ -Wl,-rpath="$(PWD)/../../.libs/"' $(AM_MAKEFLAGS) all && cd ..; \
-       done
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               cp -pfR $(srcdir)/dist-files $(builddir); \
+               cp -pf $(srcdir)/Makefile.examples.template $(builddir); \
+               for subdir in $(SUBDIRS_PROXY); do \
+                       cp -pfR $(srcdir)/$$subdir $(builddir); \
+               done; \
+       fi; \
+       if [ x"$(shell echo "$(top_srcdir)" | $(GREP) "^/" | wc -l)" = x"1" ]; then \
+               echo "Examples: absolute top_srcdir path $(top_srcdir)"; \
+               rel_src_subdir=""; \
+       else \
+               echo "Examples: relative top_srcdir path $(top_srcdir)"; \
+               rel_src_subdir="../"; \
+       fi; \
+       if [ x"$(shell echo "$(top_builddir)" | $(GREP) "^/" | wc -l)" = x"1" ]; then \
+               echo "Examples: absolute top_builddir path $(top_builddir)"; \
+               rel_build_subdir=""; \
+       else \
+               echo "Examples: relative top_builddir path $(top_builddir)"; \
+               rel_build_subdir="../"; \
+       fi; \
+       $(MAKE) -f dist-files/Makefile AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS) -I$$rel_src_subdir/$(top_srcdir)/ -I$$rel_build_subdir$(top_builddir)/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../.libs/ -Wl,-rpath "$(PWD)/../../.libs/"' $(AM_MAKEFLAGS) all;
 
 clean-local:
-       for subdir in $(SUBDIRS_PROXY); do \
-               cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..; \
-       done
+       @$(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean; \
+       if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for subdir in $(SUBDIRS_PROXY); do \
+                       rm -rf $(builddir)/$$subdir; \
+               done; \
+               rm -f $(builddir)/Makefile.examples.template; \
+               rm -rf $(builddir)/dist-files; \
+       fi;
 endif
This page took 0.02337 seconds and 4 git commands to generate.