#
# ${R_HOME}/src/library/stats4/Makefile

VPATH = @srcdir@
srcdir = @srcdir@
top_srcdir = @top_srcdir@

top_builddir = ../../..
subdir = src/library/stats4

include $(top_builddir)/Makeconf

distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE

pkg = stats4

R_EXE = $(top_builddir)/bin/R --vanilla --slave

all: Makefile DESCRIPTION
	@$(ECHO) "building package '$(pkg)'"
	@$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)
	@$(MAKE) mkR2 mkdesc mkpo
	@$(MAKE) Rfiles


Rfiles: $(top_builddir)/library/$(pkg)/R/$(pkg).rdb

$(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R
	@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
	@$(ECHO) "tools:::makeLazyLoading(\"$(pkg)\")" | \
	  R_DEFAULT_PACKAGES="methods,graphics,stats" LC_ALL=C $(R_EXE) > /dev/null


include $(top_srcdir)/share/make/basepkg.mk
