[Rd] subdirs in package src dir

Prof Brian D Ripley ripley@stats.ox.ac.uk
Thu, 3 May 2001 07:32:13 +0100 (BST)

On Wed, 2 May 2001, Albrecht Gebhardt wrote:

> Sometimes I find it useful to put C or Fortran sources under subdirs of
> "mypackage/src", especially to distinguish between my own files and
> e.g. lapack or blas sources. To get this working I would need a Makefile
> in my package which contains the appropriate dependencies to these sources
> in subdirs.
> But I don't want to add a complete Makefile, I want only a Makevars file
> containing e.g. "OBJS=myfunc.o lapack/somefunc.o ...", currently this
> would not work, because nobody looks into Makevars for an OBJS
> variable.

Err... that's not how I read the following section in SHLIB.in

if test -r Makevars; then
  makefiles="-f Makevars ${makefiles}"
  if grep '^ *OBJS *=' Makevars >/dev/null; then

The intention seems to be that OBJS is looked for in Makevars, and if
it does not work for you it needs fixing in SHLIB, not INSTALL.
It *did* work for me when I tried it:

auk% cat foo/src/Makevars
auk% Rdev INSTALL foo
Installing source package `foo' ...
gcc -I/opt/R/R-devel/include  -I/usr/local/include   -fPIC  -O2 -g -Wall
-pedantic -c foo1.c -o foo1.o
gcc -G  -o foo.so foo1.o -L/usr/local/lib
auk% ls foo/src
Makevars  foo.so*   foo1.c    foo1.o    foo2.c


> --- ./etc/Makefrag.in.objs-patch	Sat Mar  3 17:53:20 2001
> +++ ./etc/Makefrag.in	Sat Mar  3 17:53:20 2001
> @@ -0,0 +1,5 @@
> +echoobjs:
> +	@echo $(OBJS)
> +
> +echosrcs:
> +	@echo $(SRCS)

There is no such file in the current R sources that I can find: are
you working on the latest version?

Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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