# # ${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 R = $(top_builddir)/bin/R --vanilla Pkgs = base eda modreg mva stepfun Ex_R = $(Pkgs:=-Ex.R) Ex_Rout = $(Ex_R:.R=.Rout) .SUFFIXES: -Ex.R -Ex.Rout .SECONDARY: $(Ex_R) 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: $(Ex_Rout) $(Ex_Rout): %-Ex.Rout: %-Ex.R ../stamp-R $(top_builddir)/src/library/stamp-help @if [ -f $@.bak ]; then mv $@.bak $@.bakk ; fi @if [ -f $@ ]; then mv $@ $@.bak ; fi @echo "Running all help() examples ..." $(R) < $< > $@ base-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 $@ ..." @$(top_builddir)/bin/massage-Examples $* \ $(top_builddir)/library/base/R-ex/*.R > $@ %-Ex.R: $(top_builddir)/library/%/R-ex/*.R @if [ -f $@.bak ]; then mv $@.bak $@.bakk ; fi @if [ -f $@ ]; then mv $@ $@.bak ; fi @echo "Massaging examples into $@ ..." @$(top_builddir)/bin/massage-Examples $* \ $(top_builddir)/library/$*/R-ex/*.R > $@ ../stamp-R: (cd .. && $(MAKE) stamp-R) $(top_builddir)/src/library/stamp-help: (cd $(top_builddir)/src/library \ && $(MAKE) PKGS="$(Pkgs)" stamp-help) $(top_builddir)/library/%/R-ex/*.R: (cd $(top_builddir)/src/library \ && $(MAKE) PKGS="$(Pkgs)" stamp-examples) mostlyclean: clean clean: @rm -f *.R *.Rout *.Rd* *.ps *.tex *.dat* data foo* 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