[R] Compiling only some C files

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Aug 11 19:33:44 CEST 2008


2008/8/11 Lafaye de Micheaux Pierre
<Pierre.Lafaye-de-Micheaux at upmf-grenoble.fr>:
> Thank you Barry,
>
> In fact, these are only C files (not C++) and i use the extern "C"
> directive.
>
> I would prefer not to rename the files because many of these files serve
> also in other projects where they should have the .cpp extension
> I would also not like to merge all the *.cpp files in one unique file
> because many users have to provide their own C file.
>
> So i would really like to use some kind of configure or Make script, that
> should be put in the source directory tree of the R package.

If the only function of these files within the R package in question
is to be included into the other C++ files, then perhaps you could put
them in another directory and include them from there:

 #include "../extrasrc/foo.cpp"

 I'm not sure if the forward slash will work in non-Unix OSs, but it might...

 There may be some make-magic to tell make to exclude some files from
its implicit build rules, but I don't know what it is.

Barry



More information about the R-help mailing list