tup

Tup dependencies from the root directory?


I've tried to create a rule similar to the minimal example:

: ../library/something local |> !compile |> ./something_else

This works, but I would like to write something like:

: $(PROJ_ROOT)/library/something local |> !compile |> ./something_else

Where the PROJ_ROOT variable is the same, even if I add folder depth.
Does tup support this?


Solution

  • You need to pass the root directory to every subdirectory using include_rules

    In your top-level Tupfile you specify TOP = $(TUP_CWD)
    In any child you write include_rules. You can now access $(TOP)
    to get the relative path, which consists of ../../, etc.