[Rd] Problems with R CMD COMPILE within Makefile (PR#885)

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Sun, 8 Apr 2001 16:34:26 +0200


>>>>> holzer  writes:

> Dear R-developpers

> This concerns a problem I posted about half a year ago on the R-help
> list and to which I got some answer by Duncan Temple Lang (see below),
> but the basic problem still continues. Even though I managed a
> workaround which is sufficient for me Martin Maechler asked me to send
> a toy example of the problem to R-bugs. So that's what I try here.

> The following Makefile will not work:
> ----------------------------------------
> .PHONY: tst.o

> tst.o: tst.c
> 	R CMD COMPILE tst.c
> ----------------------------------------

> ...

I am not sure this is a bug: R CMD COMPILE is not documented to work
when called from inside a Makefile.

Currently, R CMD COMPILE calls Make based on information in

	Makevars		if this exists
	R_HOME/etc/Makeconf
	Makefile		if this exists

Conversely, R CMD SHLIB only uses Makevars but not Makefile.

As R CMD COMPILE is not documented to use a Makefile in the local dir, I
would propose to fix the problem by eliminating

	if test -r Makefile; then
	  makefiles="${makefiles} -f Makefile"
	fi

from the COMPILE script.

There is a more general problem, though.  We read Makevars before the
default configuration from R_HOME/etc/Makeconf.  This is to ensure that
the PKG_* variables are set when the ALL_* variables are expanded.  But
unfortunately this has the effect that global settings override the
local ones.  Is it safe to assume that we can reverse the order with all
versions of Make around?

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._