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

include ../../../share/make/vars.mk

include ../../gnuwin32/MkRules

## foo.ts is the timestamp for package foo;
## foo.tgz is a copy of foo_x.y-z.tar.gz.
## unfortunately package foo can be uninstalled and leave foo.ts

## For developers: A shell script, tools/rsync-recommended, updates
## packages from the CRAN master directory. 

OBJECTS = $(R_PKGS_RECOMMENDED:=.ts)

CLEANFILES = $(OBJECTS) stamp-recommended

.SUFFIXES:
.SUFFIXES: .tgz .ts

all: stamp-recommended

stamp-recommended: $(OBJECTS)
	@touch $@

## allow parallel installs, modulo dependencies below
INSTALL_OPTS=--pkglock --install-tests --data-compress="xz"


RCMD = ../../../$(BINDIR)/Rcmd

## force tar.exe, as internal tar gets wrong permissions on >= Vista
## when run from Cygwin
.tgz.ts:
	@echo
	@echo "----- installing recommended package" `basename $< .tgz`
	@R_INSTALL_TAR='tar.exe --no-same-owner --no-same-permissions' $(RCMD) INSTALL $(INSTALL_OPTS) -l $(RHOME)/library `basename $< .tgz`_*.tar.gz
	@touch $@

clean:
	@rm -f $(CLEANFILES)

## Hardcoded dependencies (see '../../../share/make/vars.mk')
Matrix.ts: lattice.ts
mgcv.ts: nlme.ts MASS.ts Matrix.ts
nlme.ts: lattice.ts
class.ts: MASS.ts
## and for static html links
boot.ts: MASS.ts survival.ts
cluster.ts: MASS.ts
