From simon.urbanek at r-project.org  Tue May  2 22:25:53 2006
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Tue, 2 May 2006 16:25:53 -0400
Subject: [Rd] Force action in package install?
In-Reply-To: <4457842C.3000701@stats.uwo.ca>
References: <4457842C.3000701@stats.uwo.ca>
Message-ID: <559D7B3C-2D8C-49EF-881C-4C9A420B2386@r-project.org>


On May 2, 2006, at 12:09 PM, Duncan Murdoch wrote:

> I tried putting a target that depends on FORCE into Makefile or  
> Makevars in the src directory, but it is not being built.  What  
> sort of make magic do I need, and where do I put it in order to get  
> R CMD INSTALL to run my code?
>

I don't think that's supported at all. I have successfully used this  
VeryUglyHack(TM) in the package's Makevars:

OBJECTS=dummy.o real1.o real2.o

dummy.o: myExtraTarget
	echo "" > dummy.c
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c dummy.c -o $@

where real1.o and real2.o are real object files that have  
corresponding sources and dummy.c is a non-existent file thus forcing  
make to use my extra target. This hack exploits the fact that SHLIB  
will let Makevars override the objects list (the above is not the  
exact application I use, but the essence of the idea).

I agree that it would be great to add something like $(EXTRA_TARGETS)  
to SHLIB such that Makevars can define extra targets.

Back to your original problem, though, I never build packages  
directly from development sources (didn't we have a discussion about  
this recently?) for the reasons discussed - IMHO it's much better to  
have a script build the package tar ball, stamping files as necessary.

Cheers,
Simon



[Rd] Force action in package install?
Simon Urbanek