X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=doc%2Fexamples%2FMakefile.am;fp=doc%2Fexamples%2FMakefile.am;h=028da67b7b4370f304b0c62472db6b8d616a70bf;hp=705e817d632ba4e1eb8d6e1f7189f322853ad1f8;hb=c17913dcf2555d15e3006a799dd06dbaf2cd2ee2;hpb=cfac80429e92064001addbfaf274951e68b16a44 diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 705e817..028da67 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -127,16 +127,30 @@ all-local: for subdir in $(SUBDIRS_PROXY); do \ cp -fR $(srcdir)/$$subdir $(builddir); \ done; \ - fi - $(MAKE) -f dist-files/Makefile AM_CC="$(CC)" 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 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: - $(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