Rev 21712 | Rev 23036 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
## ${R_HOME}/tests/Examples/MakefileVPATH = @srcdir@srcdir = @srcdir@top_srcdir = @top_srcdir@top_builddir = ../..subdir = tests/Examplesinclude $(top_builddir)/Makeconfdistdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)DISTFILES = Makefile.inR = $(top_builddir)/bin/R --vanillaEX_IN_BASE = $(R_PKGS_BASE:=-Ex.R)EX_OUT_BASE = $(EX_IN_BASE:.R=.Rout)EX_IN_RECOMMENDED = $(R_PKGS_RECOMMENDED_EXPANDED:=-Ex.R)EX_OUT_RECOMMENDED = $(EX_IN_RECOMMENDED:.R=.Rout).SUFFIXES:.SUFFIXES: .R .Routall: Makefile Makedeps test-ExamplesMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@Makedeps: Makefile@(for p in $(R_PKGS_BASE); 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: test-Examples-Basetest-Examples-Base: Makefile@$(MAKE) Makedeps@$(MAKE) $(EX_OUT_BASE)## <NOTE>## We do *not* want this to be added to test-Examples conditional on## @USE_RECOMMENDED_PACKAGES_TRUE.## 'make fullcheck' is used for running test-Examples-Recommended in## addition to 'make check'.test-Examples-Recommended: test-Examples-Base@$(MAKE) $(EX_OUT_RECOMMENDED)## </NOTE>R:@cd $(top_builddir) && $(MAKE) R.R.Rout:@if test -f $@.bak ; then mv $@.bak $@.bakk ; fi@if test -f $@ ; then cp -p $@ $@.bak ; fi@echo $(ECHO_N) "running code in '$<' ...$(ECHO_C)"@$(R) < $< > $@ || (mv $@ $@.fail && exit 1)@echo "$(ECHO_T) OK"$(EX_IN_BASE): FORCE@(pkg=`basename $@ -Ex.R`; \if $(PERL) $(top_srcdir)/tools/Rdnewer.pl \"$(top_srcdir)/src/library/$${pkg}" "$@"; then \if test -f $@ ; then \if test -n "`tail -6 $@ | grep '^Time elapsed'`" ; then \if test -f $@.bak ; then mv $@.bak $@.bakk ; fi; \cp -p $@ $@.bak; \fi; \fi; \echo "collecting examples for package '$${pkg}' ..."; \(cd $(top_builddir)/src/library && \OPTS="--txt --example" $(MAKE) R_PKGS_BASE="$${pkg}" DOCS); \f=$${TMPDIR-/tmp}/R$$$$; \$(PERL) $(top_srcdir)/share/perl/massage-Examples.pl $${pkg} \$(top_builddir)/library/$${pkg}/R-ex > $${f}; \$(top_srcdir)/tools/move-if-change $${f} $@; \touch $@; \fi)## The ugly 'find | grep' construct is necessary because 'test -nt' is## nonportable. The pipeline will succeed if the target exists and is## newer than the corresponding DESCRIPTION file in the package. If the## target does not exist, then find will fail; if it exists and is## older, then find will succeed but output nothing so that the grep## will fail.$(EX_IN_RECOMMENDED): FORCE@(pkg=`basename $@ -Ex.R`; \if find $@ -newer $(top_builddir)/library/$${pkg}/DESCRIPTION \-print 2> /dev/null | grep $@ > /dev/null; then :; else \if test -f $@ ; then \if test -n "`tail -6 $@ | grep '^Time elapsed'`" ; then \if test -f $@.bak ; then mv $@.bak $@.bakk ; fi; \cp -p $@ $@.bak; \fi; \fi; \echo "collecting examples for package '$${pkg}' ..."; \f=$${TMPDIR-/tmp}/R$$$$; \$(PERL) $(top_srcdir)/share/perl/massage-Examples.pl $${pkg} \$(top_builddir)/library/$${pkg}/R-ex > $${f}; \$(top_srcdir)/tools/move-if-change $${f} $@; \touch $@; \fi)FORCE:$(EX_OUT_BASE) $(EX_OUT_RECOMMENDED): Makefile \$(top_builddir)/bin/R.bin \$(top_builddir)/library/base/R/base \$(top_builddir)/modules/lapack$(SHLIB_EXT)base-Ex.Rout: $(top_builddir)/modules/vfonts$(SHLIB_EXT)mostlyclean: cleanclean:-@rm -f *.R *.Rout *.Rd* *.ps *.tex *.dat* data foo* Makedepsdistclean: clean-@rm -f *.R*bak *.R*bakk .RData sink-examp.txt Makefilemaintainer-clean: distcleandistdir: $(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: