#-*- Makefile -*-
#
# ${R_HOME}/src/library/datasets/Makefile.win

srcdir = .
top_srcdir = ../../..

top_builddir = ../../..

include $(top_builddir)/Makeconf

pkg = datasets

all:
	@$(ECHO) "building package '$(pkg)'"
	@$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)
	@$(MAKE) -f Makefile.win mkR mkdesc
	@$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)/data
	@for f in $(srcdir)/data/*; do \
	  $(INSTALL_DATA) $${f} $(top_builddir)/library/$(pkg)/data; \
	done
	@rm -f $(top_builddir)/library/$(pkg)/data/Rdata.*
	@$(ECHO) "tools:::data2LazyLoadDB(\"$(pkg)\", compress=3)" | \
	  R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null
	@$(INSTALL_DATA) $(srcdir)/data/morley.tab \
	  $(top_builddir)/library/$(pkg)/data

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

mkR:
	@$(INSTALL_DATA) $(srcdir)/NAMESPACE $(top_builddir)/library/$(pkg)
	@rm -f $(top_builddir)/library/$(pkg)/Meta/nsInfo.rds

# dummy targets
Rsimple Rlazy Rlazycomp:
