The R Project SVN R

Rev

Rev 2331 | Rev 2546 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#
# ${RHOME}/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 massage-Examples

R = $(top_builddir)/bin/R --no-init-file --no-save --no-restore --vsize 6
Rbase = $(top_builddir)/library/base/R/base
Rbinary = $(top_builddir)/bin/R.binary

all: Makefile test-Examples

Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
    cd $(top_builddir) && \
      CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
      $(SHELL) ./config.status

test-Examples: All-Ex.Rout

All-Ex.Rout: All-Ex.R R-exe
    @if [ -f $@.bak ]; then mv $@.bak $@.bakk ; fi
    @if [ -f $@ ]; then mv $@ $@.bak ; fi
    @echo "Running all help() examples ..."
    $(R) < $< > $@

All-Ex.R: $(top_builddir)/library/base/R-ex/*.R
    @if [ -f $@.bak ]; then mv $@.bak $@.bakk ; fi
    @if [ -f $@ ]; then mv $@ $@.bak ; fi
    @echo "Massaging examples into $@ ..."
    @-$(srcdir)/massage-Examples \
      $(top_builddir)/library/base/R-ex/*.R > $@

$(top_builddir)/library/base/R-ex/%.R: $(top_srcdir)/src/library/base/man/%.Rd
    (cd $(top_builddir)/src/library && \
      $(MAKE) PKGS=base stamp-examples)

R-exe:
    -(cd $(top_builddir) && $(MAKE) R)

mostlyclean: clean
clean:
    @rm -f *.Rd* *.ps *.tex *.dat* data foo*
distclean: clean
    @rm -f *.R .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