With jbuilder, when a library depends on a sub C file, say s.c, and this file #includes other C files, say p.c (because for example p.c contains generic code tailored to C and FORTRAN layouts by macros), what it the recommended way of having these files copied to the _build/ subdirectory? At the moment, I am using a “proxy” rule but that looks like a hack.
Is that to build your executables with?
In a project I need to build against that I used:
(cxx_flags (-I/usr/...))
So instead of putting them in the _build directory, you could maybe build using:
(cxx_flags (-Irelative/path))
?
The other files are in the same directory — but do not get copied to _build. To continue my example from above, suppose s.c includes i.c. If the library stanza had a deps field, I would put the file i.c in it. Of course I could use a long include path to point to the original directory but I find this no more elegant than my solution (sorry).