From delhomme at embl.de  Wed Apr 22 16:50:09 2009
From: delhomme at embl.de (delhomme at embl.de)
Date: Wed, 22 Apr 2009 16:50:09 +0200 (CEST)
Subject: [Rd] make fails when using with-x=no on linux CentOS 5.3 (PR#13670)
Message-ID: <20090422145009.D58222834321@mail.pubhealth.ku.dk>

Full_Name: Nicolas Delhomme
Version: 2.9.0
OS: Linux CentOS release 5.3 kernel 2.6.18-128.el5 arch x86_64
Submission from: (NULL) (194.94.44.4)


Hi,

The commands I used to compile R2.9.0 on CentOS
./compile --with-x=no
make

This fails with the following message:
make[2]: Leaving directory `/home/delhomme/R-2.9.0/src/modules/vfonts'
make[1]: Leaving directory `/home/delhomme/R-2.9.0/src/modules/vfonts'
make[1]: Entering directory `/home/delhomme'
make[1]: *** No rule to make target `R'.  Stop.
make[1]: Leaving directory `/home/delhomme'
make: *** [R] Error 1

What happens is the following:

In the Makefile located in the src/modules directory, there's a check for
R_MODULES (l.17-18)
## R_MODULES is X11 (or not)
MODULES = $(R_MODULES) internet lapack vfonts

This works fine, R_MODULES being defined and equal to an empty string.

Then in the R target (l.26-30)
R: Makefile make.internet make.lapack make.vfonts
       @for d in "$(R_MODULES)"; do \
            (cd $${d} && $(MAKE) $@) || exit 1; \
       done

the R_MODULES is used again and since it is an empty string, it results in
doing
cd && make R, which means going to the home directory and executes the R target
of the Makefile there. Humm... since there's no makefile in my home dir, this
obviously breaks everything up.

The fix for that is to test wether R_MODULES is not an empty string. The
following corrects the problem:

R: Makefile make.internet make.lapack make.vfonts
        @if test "$(R_MODULES)"	!= ""; then \
                for d in "$(R_MODULES)"; do \
                  (cd $${d} && $(MAKE) $@) || exit 1; \
                done; \ 
	fi

Best,

Nicolas Delhomme



[Rd] make fails when using with-x=no on linux CentOS 5.3 (PR#13670)
delhomme at embl.de