hi,
if I run make
like this:
make VAR=dir
is there a way to add the location pointed by the VAR variable as a target dependency? actually, I need to define a file inside that directory as a dependency.
I'd go with:
target: $(VAR)/file.txt
echo yes
but if the variable was not defined, the target will understand /file.txt
, which is not what I want. I also thought about creating a phony target to check for the variable, with test
, but then the phony target would be executed every time and, consequently, target
also would.
any solution to that?