I am experimenting with TUP via setting up a small test case that is 
somewhat
similar to the big build system that we use internally.  We have code 
generators
that generate multiple C++ header and source files from one input file.  
These
generators run in different directories from the source code that refers to
them.  After setting up an example like this, I am having trouble getting 
TUP
to handle a dependency on a file generated in another directory.  When I add
the dependency I get:

tup error: Explicitly named file 'One.h' is a ghost file, so it can't be 
used as an input.
tup error: Error parsing Tupfile line 2
  Line was: ': main.cpp One.h |> g++ -Wall $(INCFLAGS) -g -c main.cpp |> 
main.o'

If I don't include the dependency, I get:

 *** tup errors ***
tup error: Missing input dependency - a file was read from, and was not 
specified as an input link for the command. This is an issue because the 
file was created from another command, and without the input link the 
commands may execute out of order. You should add this file as an input, 
since it is possible this could randomly break in the future.
 - [53] build-default/basic/libgen/src/One.h

The directory structure I am using looks like this:

Tuprules.tup
basic/
  libgen/
    src/
      Tupfile
      classes.in
build-default/
  tup.config
  basic/
    libgen/
      src/
        One.cpp
        One.h
        One.o
        Other.cpp
        Other.h
        Other.o
  progs/
    basic/
      src/
        main.o
progs/
  basic/
    src/
      Tupfile
      main.cpp

Like our build system, I am using the facility to have outputs go into a 
separate
build area (build-default).  The library that contains the generation of 
files
(basic/libgen/src/Tupfile) has a Tupfile that looks like this:

: classes.in |> /var/tmp/genclass.py classes.in |> One.h One.cpp Other.h 
Other.cpp
: One.h One.cpp |> g++ -Wall -g -c One.cpp |> One.o
: Other.h Other.cpp |> g++ -Wall -g -c Other.cpp |> Other.o

The consumer of this has the following Tupfile (progs/basic/src/Tupfile):

include_rules
: main.cpp |> g++ -Wall $(INCFLAGS) -g -c main.cpp |> main.o
: main.o |> g++ -Wall -o main main.o |> main

Alternatively, the version that contains the dependency is:

include_rules
: main.cpp One.h |> g++ -Wall $(INCFLAGS) -g -c main.cpp |> main.o
: main.o |> g++ -Wall -o main main.o |> main

The former produces the message about a missing dependency, the latter 
produces
the message about a ghost file.

In order to see the include files appropriately, the top level Tuprules.tup
file contains:

INCFLAGS += -I$(TUP_CWD)/basic/libgen/src

So, maybe I am missing something simple, but I can't get TUP to be happy 
with
this setup.  It can generate and compile the files in libgen but the main
program can't seem to consume it.  Note that I haven't added the final link
options into progs/basic/src/Tupfile because it is still stuck trying to
compile the main.cpp program.  Any ideas?

        David S. Harrison

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