That's not true. You can use generated files in another Tupfile. It would 
severely limit the usefulness of tup if that weren't possible. In fact, I 
do just that in a fairly large project all the time. Here is a small 
example:

bash$ ls -l a b

a:

total 24

-rw-r--r--  1 ajensen  staff  165 Jan 27 21:53 ClassA.cc

-rw-r--r--  1 ajensen  staff  103 Jan 27 21:53 ClassA.h

-rw-r--r--  1 ajensen  staff   44 Jan 27 21:36 Tupfile


b:

total 16

-rw-r--r--  1 ajensen  staff   80 Jan 27 21:47 Tupfile

-rw-r--r--  1 ajensen  staff  141 Jan 27 21:52 main.cc

bash$ for fn in a/* b/*; do echo "================ $fn ================"; 
cat $fn; done            

================ a/ClassA.cc ================

#include "ClassA.h"

#include <iostream>


ClassA::ClassA()

    : member_(9) {

}


void ClassA::doit() {

    std::cout << "ClassA: value = " << member_ << std::endl;

}

================ a/ClassA.h ================

class ClassA {

    public:

        ClassA();

        void doit();

    private:

        int member_;

};

================ a/Tupfile ================

: foreach *.cc |> g++ -c -o %B.o %f |> %B.o

================ b/Tupfile ================

: foreach *.cc |> g++ -c %f -o %o |> %B.o

: *.o ../a/*.o |> g++ -o %o %f |> foo

================ b/main.cc ================

#include "../a/ClassA.h"

#include <iostream>


int

main(int argc, char** argv) {

    printf("Hello, World!\n");

    ClassA a;

    a.doit();

}

bash$ tup

[ tup ] [0.000s] Scanning filesystem...

[ tup ] [0.018s] Reading in new environment variables...

[ tup ] [0.019s] Parsing Tupfiles...

 1) [0.005s] a

 2) [0.007s] b                                                             
                                 

 [  ] 100%

[ tup ] [0.064s] No files to delete.                                       
                                 

[ tup ] [0.064s] Generating .gitignore files...

[ tup ] [0.064s] Executing Commands...

 1) [0.502s] b: g++ -c main.cc -o main.o                                   
                                 

 2) [0.518s] a: g++ -c -o ClassA.o ClassA.cc                               
                                 

 3) [0.084s] b: g++ -o foo main.o ../a/ClassA.o                            
                                 

 [   ] 100%

[ tup ] [0.668s] Updated.                                                  
                                 

bash$ b/foo

Hello, World!

ClassA: value = 9

bash$ 

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