Ok. I understand. Thanks for all of the answers!

On Thursday, November 14, 2024 at 12:49:22 AM UTC [email protected] wrote:

> 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*. 
>
> On 13/11/24 23:42, Sean Russell wrote:
>
> 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
>
> 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: [email protected]
> unsubscribe: [email protected]
> 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 [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/tup-users/ba8db968-f957-40b0-bf38-c79f464e3a3fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tup-users/ba8db968-f957-40b0-bf38-c79f464e3a3fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/tup-users/2270b453-245b-4502-8e3b-5f0363da8647n%40googlegroups.com.

Reply via email to