#-*- Makefile -*-
include ../gnuwin32/MkRules
R_HOME = ../..

## BATCH and REMVOE are handled internally in Rcmd.exe

all: \
 $(R_HOME)/bin/build $(R_HOME)/bin/check $(R_HOME)/bin/config.sh \
 $(R_HOME)/bin/Rdconv $(R_HOME)/bin/Rd2dvi.sh $(R_HOME)/bin/Sd2Rd \
 $(R_HOME)/bin/Rprof $(R_HOME)/bin/INSTALL.sh $(R_HOME)/bin/SHLIB.sh \
 $(R_HOME)/bin/Stangle.sh $(R_HOME)/bin/Sweave.sh $(R_HOME)/bin/Rd2txt.sh

$(R_HOME)/bin/check: check.in
	@$(SED) -e 1d $< > $@

$(R_HOME)/bin/build: build.in
	@$(SED) -e 1d $< > $@

$(R_HOME)/bin/Sd2Rd: Sd2Rd.in
	@$(SED) -e 1d $< > $@

$(R_HOME)/bin/Rdconv: Rdconv.in
	@$(SED) -e 1d -e s/\"unix\"/\"windows\"/ $< > $@

$(R_HOME)/bin/Rprof: Rprof.in
	@$(SED) -e 1d $< > $@

$(R_HOME)/bin/Rd2dvi.sh: Rd2dvi
	@cp $< $@

$(R_HOME)/bin/config.sh: config
	@cp $< $@

$(R_HOME)/bin/INSTALL.sh: INSTALL
	@cp $< $@

$(R_HOME)/bin/SHLIB.sh: SHLIB
	@cp $< $@

$(R_HOME)/bin/Stangle.sh: Stangle
	@cp $< $@

$(R_HOME)/bin/Sweave.sh: Sweave
	@cp $< $@

$(R_HOME)/bin/Rd2txt.sh: Rd2txt
	@$(SED) -e s/exec/perl/ $< > $@
