That's about on par with the only other [also hacky] solution I've thought 
of, something like:

!CC = |> pushd `git rev-parse --show-toplevel 1>/dev/null && gcc $(CFLAGS) 
-c \$(dirs +1)/%f -o %o |>

... though that would require the shell to be bash instead of /bin/sh (I 
still haven't figured out how to change the default shell away from 
/bin/sh), or something involving "&" variables (I think that'd be the best 
solution if I cannot do away with the automatic directory change).

-brian

On Wednesday, November 30, 2016 at 7:01:04 AM UTC-7, Erik wrote:
>
> Could you not also do something like:
> cat Tuprules.tup <<<EOF
> ROOT = $(TUP_CWD)
> !CC = |> DIR=`pwd` && cd $(ROOT) && gcc -c $DIR/%f -o $DIR/%o |> %B.o
> EOF
>
> cat nested/directories/Tupfile <<<EOF
> include_rules
> foreach *c |> !CC |>
> EOF
>
> It's pretty hacky, and I don't necessarily recommend it, but it seems like 
> it might work.
>
> On Wed, Nov 30, 2016, 03:59 Freddie Chopin <[email protected] 
> <javascript:>> wrote:
>
>> On Tue, 2016-11-29 at 07:41 -0800, Brian Vandenberg wrote:
>> > How can I get tup to build from a common root (that is, not switch
>> > directories to where each tupfile is)?
>>
>> You cannot do anything more than have a single Tupfile in the common
>> root. In the subfolders you can however have some special files (with
>> build description of these subfolders) which can be included manually
>> by the top-level Tupfile.
>>
>> Regards,
>> FCh
>>
>> --
>> --
>> tup-users mailing list
>> email: [email protected] <javascript:>
>> unsubscribe: [email protected] <javascript:>
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to