Hi Xan,
Tup runs a little differently from other build-systems - one of the
restrictions is that a Tupfile can only write to files in the current
directory. In this case since you want to write to a file in directory
b/, create b/Tupfile like so:
: ../a/file.txt |> cp %f %o |> file2.txt
My directory structure looks like this:
srcdir/
.tup (I ran 'tup init' in srcdir/)
a/
file.txt
b/
Tupfile
file2.txt (created after 'tup upd')
The reason tup is restricted like this is to simplify parsing so that
tup can just jump to any directory and parse the Tupfile there. This
lets tup skip parsing Tupfiles when they haven't changed, which is
noticeable for large projects.
-Mike