X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=doc%2Fexamples%2FMakefile.am;h=88f8968d6cece535391f4106ecba4ea5300cf097;hp=60848e912f8d85bc571db5fe0fb8d49ddc98f158;hb=6893800a4d1cc14dff0395ddcd660a5138db183d;hpb=650b434b12597af49cad28c5c4b5faa3c98c04b0 diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 60848e9..88f8968 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -98,18 +98,62 @@ dist_doc_examples_rculfhash_DATA = \ 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_del.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 = hlist list urcu-flavors wfcqueue rculfqueue \ + wfstack lfstack rculfhash + +# Copies are for VPATH build support. all-local: - $(MAKE) -f dist-files/Makefile AM_CPPFLAGS="-I../../../urcu/ -I../../../" AM_LDFLAGS='-L../../../.libs/ -Wl,-rpath="$(PWD)/../../.libs/"' $(AM_MAKEFLAGS) all + @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ + cp -pfR $(srcdir)/dist-files $(builddir); \ + chmod -R u+w $(builddir)/dist-files; \ + cp -pf $(srcdir)/Makefile.examples.template $(builddir); \ + chmod u+w $(builddir)/Makefile.examples.template; \ + for subdir in $(SUBDIRS_PROXY); do \ + cp -pfR $(srcdir)/$$subdir $(builddir); \ + chmod -R u+w $(builddir)/$$subdir; \ + 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)/include/ -I$$rel_src_subdir/$(top_srcdir)/src/ -I$$rel_build_subdir$(top_builddir)/include/ -I$$rel_build_subdir$(top_builddir)/include/src/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"' $(AM_MAKEFLAGS) all; clean-local: - $(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean; + @$(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