If you put main.cpp in a different directory you can do it using globs and 
bins, see the {bin} section in the manual. Something like this should work:

: objs/*.c |> compile |> %B.o {objs}
: main.cpp |> compile |> %B.o
: {objs} main.o |> link |> a.out
# reuse {objs}
: {objs} |> test |> test

On Wednesday, June 4, 2014 4:39:16 PM UTC-4, [email protected] 
wrote:
>
> Howdy,
>
> This is no doubt simple, but it's my first use of tup. I have a small 
> program and a sibling unit test executable, like so:
>
> src/
>   - foo.cpp
>   - bar.cpp
>   - main.cpp
>
> test/
>   - test_foo.cpp
>   - test_bar.cpp
>   - test.cpp
>
> Both src/ and test/ generate executables. In the Tupfile for test/, how do 
> I include all the .o files from src/ *except* for main.o? Note that my 
> extreme laziness means I'm not putting foo.o and bar.o into a library and 
> that I'd hate to list foo.o and bar.o in test/Tupfile's linker rule.
>
> i.e., in test/Tupfile, my inclination is to do something like:
>
> : *.o (../src/*.o - main.o) |> !link %f %o |> test
>
> tia,
>
> Jon
>
>

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