It is not really clear, but I think you should indeed read it as
The name of the lowest level of the directory [of the Tupfile this flag appears in.]
More generally, Tup does not accommodate well performing actions in other directories than the current Tupfile. I you want to create a/b/c.out, then the rule should reside in a/b/Tupfile. Not in the top-level Tupfile.
If you want to generate rules programmatically, you may have to consider lua and other scripting capabilities of Tup.
At this point it gets difficult to help without seeing the code,
but let me try
Thanks! I'd looked at macros earlier, but ran into a different issue I don't understand. Per the manual, both inputs and outputs should be able to be specified in a macro:
!macro = [inputs] | [order-only inputs] |> command |> [outputs]
So, I'm thinking, at the top level in my Tuprules.tup:
!mmac = input.suf | ../../ooinp.suf |> compilecommand --style %d %i |> ../../tmp/%d-%B
I think your inputs in a rule should be relative to where the rule is used. Is that what this rule does ?
I am sure however that you are not supposed to output in another
folder than the one where your Tupfile is.
A core assumption of Tup is that the rule producing a/b/c/foo.bar
will be in a/b/c/Tupfile.
So ... |>
../../tmp/%d-%B will always be wrong.
From this, all the examples below are doomed to fail.
and in my project/styles/style1/Tupfile:
include_rules: |> !mmac |>
(because without the pipes bracketing the rule, tup complains about missing pipes) at which point tup tells me that "!-macros can't have normal inputs, only order-only inputs."
I also tried putting the input in the rule, and the order-only input in the macro, but even with various combinations of pipe placement in both the macro and the rule I never got anything other than the error message about normal inputs.
Then I tried putting all of the inputs in the rule, and only the outfile in the Tuprules.tup, which is explicitly allowed in the manual:
You will only want to specify the output parameter in either the !-macro or the :-rule that uses it
!mmac = |> compilecommand --style %d %i |> ../../tmp/%d-%B
and in the deep Tupfile:
include_rules: input.suf | ../../ooinp.suf |> !mmac |>
which gives me a "Missing second '|>' marker" error; adding one to the end of the macro, so that everything (except the start of the rule) is now bracketed, still generates the missing second marker error. However, if I put both all inputs and outputs in the rule, it runs -- sort of. But now in complains that the top-level Tupfile rule that uses the output of the deep Tupfile is "Unable to use inputs from a generated directory that isn't written by this Tupfile." Here's where I got stuck (I've trimmed it down to a bare minimum needed to generate the error):
./Tupfile:
: foreach tmp/* |> cmd1 %f %o |> out/%B-%t.pdf
./Tuprules.tup:
!mmac = |> cmd2 %f %o |>
./styles/style/Tupfile:
include_rules: input.ext | ../../ooinput.ext |> !mmac |> ../../tmp/%d-%B
I get the impression that macros can only be used in the commands. If that's not correct, could you provide a minimal example of providing order-only inputs or outputs in a macro that demonstrates my error? And is there a way of getting around this directory error? Another rule in the top-level Tupfile to explicitly create temporary directories?
Thank you.
--
--
tup-users mailing list
email: tup-...@googlegroups.com
unsubscribe: tup-users+...@googlegroups.com
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups "tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tup-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/tup-users/ba8db968-f957-40b0-bf38-c79f464e3a3fn%40googlegroups.com.
Indeed, this is the first line of the Tupfiles section in the manual.
Not sure there is a good place for this really, but maybe under
rules would help.
TUPFILES
You must create a file called "Tupfile" anywhere in the tup hierarchy that you want to create an output file based on the input files. The input files can be anywhere else in the tup hierarchy, but the output file(s) must be written in the same directory as the Tupfile.