On Tue, Jan 18, 2022 at 02:49:37PM +0100, Jan Beulich wrote:
> On 18.01.2022 12:06, Anthony PERARD wrote:
> > On Tue, Dec 21, 2021 at 02:53:49PM +0100, Jan Beulich wrote:
> >> On 25.11.2021 14:39, Anthony PERARD wrote:
> >>> Rather than preparing the efi source file, we will make the symbolic
> >>> link as needed from the build location.
> >>>
> >>> The `ln` command is run every time to allow to update the link in case
> >>> the source tree change location.
> >>
> >> Btw, since symlinks aren't being liked, would there be a way to make
> >> things work using vpath?
> >
> > No, that's not possible. With "vpath = /build/xen/common/efi", make
> > would look at path "/build/xen/common/efi/arch/x86/efi/runtime.c" to
> > build "arch/x86/efi/runtime.o".
>
> But /build/xen/common/efi/arch/x86/efi/runtime.c doesn't exist (and
> never will afaict), so wouldn't make go on finding the file elsewhere?
If we have the implicit rule
%.o: %.c
and vpath set.
When trying to build the target "arch/x86/efi/runtime.o", make will try
our above rule and look for "arch/x86/efi/runtime.c" as make will not
remove the directory part from the path. If that prerequisite isn't
found, make will also try to prepend $(VPATH) to it.
I don't think it's not possible to tell make to substitute a directory
for vpath, in a target or prerequisite.
Cheers,
--
Anthony PERARD