From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-11-08 02:48:27
Schnyder Franz wrote:
>> What you want is CPP -> LST -> OBJ and C -> LST -> OBJ, correct? When
>> compiling a C file with VxWorks, I'm assuming you don't need to "munch"
>> it. If so, why don't you have C -> OBJ as normal, and
> No not exactly, sorry I did explain ist very precise in my fist mail.
> So I created the the composing list rule 'OBJ -> LST' which collects all
> Objects and since muching doesn't care if there are also Objects from C
> files in the list I just added all objects. Then created the munch rule
> 'LST -> C'. I compiled the resulting file and then linked all the
> objects from the lst file and the additional object from the munching
> into an "executable".
Ok. I think I understand now. With what you have above, you are going to
run into problems because you have:
CPP -> LST -> OBJ
C ---/ \-> C -> OBJ
^^^^^^^^ ambiguity here
So, now IIUC VxWorks needs to compile a C++ program into C code and C
code can be compiled into object form, so you have:
: CPP : C : <toolset>vxworks ; # C++ -> C
: C : OBJ : <toolset>vxworks ; # C -> OBJ
Now you have a set of object files that need munching. You can use a
standard link generator/rule, but instead of...
linker <object-files> output
...you will have...
@($(STDOUT):E=$(nl)"$(>)") > "$(<).lst"
munch "$(<).lst" "$(<)_munched.c"
link "$(>)" "$(<)_munched.obj"
1 -- generate the list file from the object file inputs;
2 -- munch that list into a C file;
3 -- compile the munch file;
4 -- link in the object files with the munchable file.
This way, you break the ambiguity, but still do the munching.
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