X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=doc%2Fexamples%2FMakefile.am;h=734582a0852af209af94ed4045714500df11a12a;hp=7687098187d6474395812f8b73fe018c6d915131;hb=9a79c612003362a97217613b7906a4782977d373;hpb=223c9ed052d32fd078df0fcd48ce7732cdbe0165 diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 7687098..734582a 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -122,21 +122,38 @@ SUBDIRS_PROXY = hlist list urcu-flavors wfcqueue rculfqueue \ # Copies are for VPATH build support. all-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - cp -fR $(srcdir)/dist-files $(builddir); \ - cp -f $(srcdir)/Makefile.examples.template $(builddir); \ + 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 -fR $(srcdir)/$$subdir $(builddir); \ + cp -pfR $(srcdir)/$$subdir $(builddir); \ + chmod -R u+w $(builddir)/$$subdir; \ done; \ - fi - $(MAKE) -f dist-files/Makefile AM_CPPFLAGS="$(CPPFLAGS) -I../../../urcu/ -I../../../" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../.libs/ -Wl,-rpath="$(PWD)/../../.libs/"' $(AM_MAKEFLAGS) all + 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 CC="$(CC)" CPPFLAGS="$(CPPLAGS)" 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) $(PTHREAD_CFLAGS)" LDFLAGS="$(LDFLAGS)" AM_LDFLAGS="$(AM_LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"" $(AM_MAKEFLAGS) all; clean-local: - $(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean - @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ + @$(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 + fi; endif