-
Bug
-
Resolution: Fixed
-
P4
-
16
-
None
-
b07
The DependOnVariable macro fails if the variable is empty. The failure is rather non intuitive as it complains that the vardeps file doesn't exist and is needed for the target.
DependOnVariable works by creating a file that contains the value of a variable, and only recreates the file if it either doesn't exist yet, or the value of the variable has changed since last time. This makes it possible to have make targets depend on this file and so get rebuilt if a variable value has changed.
The problem here is that the macro doesn't handle empty variable values gracefully.
Another issue discovered while investigating this is that the automatically generated file name for the vardeps file is using TOPDIR instead of WORKSPACE_ROOT to rewrite a path from absolute to relative. This causes custom makefile extensions using this macro to potentially generate very strange and deep file paths.
DependOnVariable works by creating a file that contains the value of a variable, and only recreates the file if it either doesn't exist yet, or the value of the variable has changed since last time. This makes it possible to have make targets depend on this file and so get rebuilt if a variable value has changed.
The problem here is that the macro doesn't handle empty variable values gracefully.
Another issue discovered while investigating this is that the automatically generated file name for the vardeps file is using TOPDIR instead of WORKSPACE_ROOT to rewrite a path from absolute to relative. This causes custom makefile extensions using this macro to potentially generate very strange and deep file paths.