Boost logo

Boost-Build :

Subject: [Boost-build] Conditional updating using NOUPDATE
From: Edward Mitchell (erm410_at_[hidden])
Date: 2013-04-24 15:25:00


Here is a brief overview of my problem. I have a target (scrape_flag.h)
that I want to update in two cases:

1) The file does not exist in the build directory.
2) A python script that runs at the beginning of the build exits with a
0 value.

I initially tried using an empty alias when the python script exited
with a non-zero value. However, this did not solve point 1), and targets
that had scrape_flag.h as an implicit dependency failed because they do
not include the build directory in the header search.

I then tried applying the built in NOUPDATE rule (as well as NoUpdate)
when the exit status is non-zero. However, this does not add NOUPDATE to
the output for scrape_flag.h when running with -d+12. The code I am
using to define the target is below:

rule scrape( dir )
out = [ SHELL "cd $(dir); export PYTHONPATH=`pwd`:${PYTHONPATH}; python
$(.common)/ *.cc *.h" : exit-status ] ;
      local bname = $(dir:B)_scrape_flag.h ;
      if $(out[2]) = 0 {
          ECHO $(out[1]) ;
      } else {
         ECHO "No changes found" ;
         NOUPDATE $(bname) ;
      make $(bname) : : @cando.touch ;

actions touch {
     touch $(<)

Is this the wrong way to use NOUPDATE, or is there a better way to
approach the problem in general. Thank you for any help you can give me.


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at