I'd like to know if there's any wildcard for directory structure in Tupfile, something like %B.o, which takes input filename without extension.
My Tupfile rules currently look like this:
: foreach src/*.cpp |> !cxx_c_debug |> build/d/o/%B.o
: foreach src/dir/*.cpp |> !cxx_c_debug |> build/d/o/dir/%B.o
: foreach src/dir2/subdir/*.cpp |> !cxx_c_debug |> build/d/o/dir2/subdir/%B.o
...
As you can imagine, there are many dirs and subdirs. I would like to use some kind of wildcard for bolded directory structure, instead of enumerating those one by one. Is there any way to accomplish this without creating a new Tupfile in each of those directories?
Thanks
The easiest way will be to use a
Tupdefaultfile.This is a feature, available in tup 0.7.4, but not yet documented. If you place a file named
Tupdefaultanywhere in your source tree, it will act at theTupfilein all subdirectories, including the one where you placed it.To get your particular example working, the
Tupdefaultfile can look like this:You'll probably also need to use the tup's groups feature to collect all object files in a single group placed in your project root and use that group to link them together. This is another feature that is currently being documented, but it's explained by tup's author Mike Shal here:
https://github.com/gittup/tup/issues/85#issuecomment-19423194