120 # Computes the relative path from a directory to a file |
120 # Computes the relative path from a directory to a file |
121 # $1 - File to compute the relative path to |
121 # $1 - File to compute the relative path to |
122 # $2 - Directory to compute the relative path from |
122 # $2 - Directory to compute the relative path from |
123 RelativePath = \ |
123 RelativePath = \ |
124 $(eval $1_prefix := $(call FindCommonPathPrefix, $1, $2)) \ |
124 $(eval $1_prefix := $(call FindCommonPathPrefix, $1, $2)) \ |
125 $(eval $1_dotdots := $(call DirToDotDot, $(patsubst $($(strip $1)_prefix)/%, %, $2))) \ |
125 $(eval $1_dotdots := $(call DirToDotDot, $(patsubst $($(strip $1)_prefix)%, %, $2))) \ |
|
126 $(eval $1_dotdots := $(if $($(strip $1)_dotdots),$($(strip $1)_dotdots),.)) \ |
126 $(eval $1_suffix := $(patsubst $($(strip $1)_prefix)/%, %, $1)) \ |
127 $(eval $1_suffix := $(patsubst $($(strip $1)_prefix)/%, %, $1)) \ |
127 $($(strip $1)_dotdots)/$($(strip $1)_suffix) |
128 $($(strip $1)_dotdots)/$($(strip $1)_suffix) |
128 |
129 |
129 ################################################################################ |
130 ################################################################################ |
130 # Filter out duplicate sub strings while preserving order. Keeps the first occurance. |
131 # Filter out duplicate sub strings while preserving order. Keeps the first occurance. |