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

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

top_builddir = ../../..
subdir = src/library/grid

include $(top_builddir)/Makeconf

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

pkg = grid

RSRC = `LC_COLLATE=C ls $(srcdir)/R/*.R`

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

all: Makefile DESCRIPTION
	@$(ECHO) "building package '$(pkg)'"
	@$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)
	@$(MAKE) mkR mkdesc instfiles mkpo
	@$(MAKE) mksrc
	@$(MAKE) mklazy

instfiles:
	@if test -d $(srcdir)/inst/doc; then \
	  $(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)/doc; \
	  for f in $(srcdir)/inst/doc/*; do \
	    $(INSTALL_DATA) $${f} $(top_builddir)/library/$(pkg)/doc; \
	  done; \
	fi


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