That's a great idea, I'll try that out and post my results.

Thanks Neil!

On Monday, 26 May 2014 03:31:26 UTC+12, Neil Shepperd wrote:
>
> Hi, 
>
> > : foreach *.c |> gcc -Wall -Wextra -std=c11 -c %f -o %o |> %B.o 
> {ALL_OBJS} 
> > : foreach Test_*.o |> gcc {ALL_OBJS} -o %o |> %B.exe {TEST_EXES} 
> > : foreach {TEST_EXES} |> ./%f |> 
> > 
> > What I am trying to do here is to re-link test executables only if its 
> > link-time dependencies change by over-specifying (specifying all the 
> > object files that were generated from the compile step). I am hoping Tup 
> > figures out which ones are actually read by the linker and that only the 
> > appropriate tests are re-linked if a certain object file changes. 
>
> You probably want to use a static library with the ^o^ flag, like this: 
>
>     : foreach Test_*.o | library.a |> ^o^ gcc -o %o %f library.a |> %B.exe 
> {TEST_EXES} 
>
> The ^o^ flag tells tup to compare the linker output against the previous 
> run, 
> so when library.a changes all your tests will be relinked but only the 
> ones 
> using symbols from object files that have been modified will be re-run. 
>
> (http://gittup.org/tup/manual.html#lbAH) 
>
> This relies on the linker returning identical output when the symbols a 
> program 
> actually uses haven't changed, which does seem to work from limited 
> testing with 
> the gcc linker. But if the linker /isn't/ completely deterministic wrt the 
> subset 
> of symbols actually used, some tests might be run unnecessarily. 
>
> Regards, 
> Neil 
>
>

-- 
-- 
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