|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-08-06 05:16:54
Markus Schöpflin wrote:
> Aha, I think I can work it out now. Let's see...
>
> rule link-oci-libs ( toolset variant : properties * )
> {
> switch $(toolset)
> {
> case gcc* :
> {
> return $(properties) <linkflags>"blah blah" ;
> }
> case msvc* :
> {
> return $(properties) <find-library>ociw32 ;
> }
> }
> }
>
> exe foo : $(CPP_SOURCES).cpp : link_oci_libs ;
Yea, that's probably simpler to use.
> Hmm, is there any way to execute a shell command from within
> a rule? Something like $(SHELL: make -f somefile echo_libs).
Not directly. You can make a target which will receive output of make, then
load that target in build actions, somethink like
actions gcc-link {
gcc ...... `cat file-with-options`
}
I suppose this is not what you want. Would it be OK to just run make once, to
generate a file with list of options, and then include that file? Hmm...
you'd need to make "make" output some variable declaration, such as
OCI_LIBS_LINKER_FLAGS = ...... ;
However, in this case, you won't be able to make anything depend on that file.
- Volodya
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk