A have a make target foo/%.bar. It corresponds to files, for example:
foo/x/y/z.bar
foo/a.bar
Now I want a precondition prereq.othat must be in the same folder as the file .bar. Thus, for foo/x/y/z.bara prerequisite should be foo/x/y/prereq.o, for foo/a.barit should be foo/prereq.o.
How to do it?
I tried using the function diras follows:
foo/%.bar : foo/$(dir %)prereq.o
However, this does not work, because functions are evaluated before the templates are expanded. So how does it work?
source
share