On Tue, Dec 21, 2021 at 03:18:34PM +0100, Jan Beulich wrote:
> On 25.11.2021 14:39, Anthony PERARD wrote:
> > Reorganize a bit the Makefile ahead of patch
> > "build: adding out-of-tree support to the xen build"
> 
> Without you saying so it's not clear why that's good of even
> necessary. Moving things around always has the potential of
> breaking subtle ordering requirements, so I'd prefer to see
> what good the movement does.

Some explanation about why most of the code movement is needed:


In Kbuild, *srctree and *objtree are been set after setting $(quiet),
$(Q), $(KBUILD_VERBOSE). We will do the same. Also, we need to set the
$(*tree) variables only on first execution of Makefile, not in sub-make,
the we need to move them. Been before or after $(KBUILD_VERBOSE) doesn't
seems to matter, but they needs to be in the area, in "root-make-done"
guard.

$(XEN_ROOT) as the same issue as $(*srctree), it will be set only after we
know the value of $(abs_srctree).

"Kbuild.include" needs to be included after $(srctree) is set.

We can't include "Config.mk" without knowing $(XEN_ROOT), it needs to move.

We can't calculate without $(TARGET_*ARCH) without $(XEN_TARGET_ARCH)
which is set if needed in "Config.mk".

$(ARCH) and $(SRCARCH) seems misplaced before the patch, Not moving them
might mean wrong value might be exported if "Config.mk" isn't included.
I think I have to investigate this one, and potentially produce a new patch.

So the code movement is just because we need to be careful when setting
the different $(*tree) variables, and $(XEN_ROOT).


I'll add something like that to the commit message.

Cheers,

-- 
Anthony PERARD

Reply via email to