[Rd] Force action in package install?

Simon Urbanek simon.urbanek at r-project.org
Tue May 2 22:25:53 CEST 2006

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.


More information about the R-devel mailing list