X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=doc%2Fexamples%2FMakefile.am;h=20463812866b31a592152141e9dd417ee7655d0d;hb=1136f4540f901b884c76fe011a468f2257d30a0f;hp=9441296b5c97c2528f95e8973a84ebe113e60f25;hpb=2dbf31c9e6479b126f67a3494a9b4dfaa57b39b3;p=urcu.git diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 9441296..2046381 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -102,20 +102,52 @@ dist_doc_examples_rculfhash_DATA = \ 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_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 +# Building the examples requires the shared libraries to be enabled +if ENABLE_EXAMPLES + +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 + $(AM_V_at)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 \ + rel_src_subdir=""; \ + else \ + rel_src_subdir="../"; \ + fi; \ + if [ x"$(shell echo "$(top_builddir)" | $(GREP) "^/" | wc -l)" = x"1" ]; then \ + rel_build_subdir=""; \ + else \ + rel_build_subdir="../"; \ + fi; \ + $(MAKE) -f dist-files/Makefile CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" AM_CPPFLAGS="$(AM_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/"" CFLAGS="$(CFLAGS)" AM_CFLAGS="$(AM_CFLAGS)" LDFLAGS="$(LDFLAGS)" AM_LDFLAGS="$(AM_LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"" AM_V_P="$(AM_V_P)" AM_V_at="$(AM_V_at)" $(AM_MAKEFLAGS) all; clean-local: - $(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean; + $(AM_V_at)$(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