From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2006-01-24 03:21:25
I'm playing around a bit with Bbv2 and the SHELL rule. I've got a "deps"
subdirectory within my project, containing source depedencies for my
project. I've created some Ruby scipts under deps/build to do cvs updates
for boost, storing the sources under deps/src/boost.
I've been running these update/build/install scripts manually, but I figured
I could instead run them using the SHELL built-in (which basically works
fine) on explicit request. This is my simplified project layout.
--- <project-root> project-root.jam boost-build.jam Jamfile.v2 <deps> <build> Jamfile.v2 update.rb build.rb update_boost.rb build_boost.rb ... etc ... --- I added this to my root Jamfile: --- alias deps : deps/build ; explicit deps ; --- and this into a new Jamfile under deps/build: --- path-constant CD : . ; import path ; update_args = [ path.native $(CD) ] ; update_args = [ path.join $(update_args) update.rb ] ; build_args = [ path.native $(CD) ] ; build_args = [ path.join $(build_args) build.rb ] ; # # Update and build dependencies # ECHO [ SHELL "ruby "$(update_args) ] ; ECHO [ SHELL "ruby "$(build_args) ] ; --- This works as far as to execute the 'update' and 'build' scripts. What I'd like to do is to add support for selecting only to update or build the dependencies. I tried the below changes, but both of the shell arguments always execute (which is probably expected, as I don't really understand what I'm doing): --- root Jamfile --- alias deps_build : deps/build//build ; alias deps_update : deps/build//update ; --- deps/build Jamfile --- path-constant CD : . ; import path ; update_args = [ path.native $(CD) ] ; update_args = [ path.join $(update_args) update.rb ] ; build_args = [ path.native $(CD) ] ; build_args = [ path.join $(build_args) build.rb ] ; # # Update and build dependencies # project update ; ECHO [ SHELL "ruby "$(update_args) ] ; project build ; ECHO [ SHELL "ruby "$(build_args) ] ; --- Some related questions: 1) Is is possible to tell SHELL not to capture output, and simply echo it to the console as it goes? For my specific situation the output could get really huge when many things have changed since last update, or the first time the scripts are run. 2) Can I make other projects depend on the successful execution of specific shell commands? Thanks // Johan
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