# # ${R_HOME}/tests/Examples/Makefile VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = ../.. subdir = tests/Examples include $(top_builddir)/Makeconf distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) DISTFILES = Makefile.in R = $(top_builddir)/bin/R --vanilla EX_IN = $(R_PKGS:=-Ex.R) EX_OUT = $(EX_IN:.R=.Rout) .SUFFIXES: .SUFFIXES: .R .Rout all: Makefile Makedeps test-Examples Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @cd $(top_builddir) && \ CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \ $(SHELL) ./config.status Makedeps: Makefile @(for p in $(R_PKGS); do \ dep="$${p}-Ex.Rout: $${p}-Ex.R"; \ dep="$${dep} \$$(top_builddir)/library/$${p}/R/$${p}"; \ tmp="library/$${p}/libs/$${p}" ; \ if test -f $(top_builddir)/$${tmp}.$(SHLIB_EXT); then \ dep="$${dep} \$$(top_builddir)/$${tmp}.\$$(SHLIB_EXT)"; \ fi; \ dep="$${dep} \$$(FORCE)"; \ echo $${dep}; \ done) >> Makefile @touch $@ test-Examples: Makefile @$(MAKE) Makedeps @$(MAKE) $(EX_OUT) R: @cd $(top_builddir) && $(MAKE) R .R.Rout: @if [ -f $@.bak ]; then mv $@.bak $@.bakk ; fi @if [ -f $@ ]; then cp -p $@ $@.bak ; fi @echo "running code in $< ..." $(R) < $< > $@ $(EX_IN): FORCE @(pkg=`basename $@ -Ex.R`; \ if $(top_builddir)/tools/Rdnewer \ "$(top_srcdir)/src/library/$${pkg}" "$@"; then \ if test -f $@.bak ; then mv $@.bak $@.bakk ; fi; \ if test -f $@ ; then cp -p $@ $@.bak ; fi; \ echo "collecting examples for package \`$${pkg}' ..."; \ (cd $(top_builddir)/src/library && \ OPTS="--txt --example" $(MAKE) R_PKGS="$${pkg}" DOCS); \ f=$${TMPDIR-/tmp}/R$$$$; \ $(top_builddir)/bin/massage-Examples $${pkg} \ $(top_builddir)/library/$${pkg}/R-ex/*.R > $${f}; \ $(top_srcdir)/tools/move-if-change $${f} $@; \ fi) FORCE: $(EX_OUT): Makefile \ $(top_builddir)/bin/R.bin \ $(top_builddir)/library/base/R/base mostlyclean: clean clean: @rm -f *.R *.Rout *.Rd* *.ps *.tex *.dat* data foo* Makedeps distclean: clean @rm -f *.R*bak *.R*bakk .RData sink-examp.txt Makefile maintainer-clean: distclean distdir: $(DISTFILES) @for f in $(DISTFILES); do \ test -f $(distdir)/$${f} \ || ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \ || cp -p $(srcdir)/$${f} $(distdir)/$${f}; \ done ## Automagically generated dependencies: