build: tweak variable exporting for make 3.82
authorJan Beulich <jbeulich@suse.com>
Thu, 2 Jul 2020 09:11:40 +0000 (11:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 2 Jul 2020 09:11:40 +0000 (11:11 +0200)
commitbe63d9d47f571a60d70f8fb630c03871312d9655
treefb4cbb1ac3e4f96104d9f6a26b5774bae73ea06b
parent5b718d24e88ceb2c28010c647836929b85b22b5d
build: tweak variable exporting for make 3.82

While I've been running into an issue here only because of an additional
local change I'm carrying, to be able to override just the compiler in
$(XEN_ROOT)/.config (rather than the whole tool chain), in
config/StdGNU.mk:

ifeq ($(filter-out default undefined,$(origin CC)),)

I'd like to propose to nevertheless correct the underlying issue:
Exporting an unset variable changes its origin from "undefined" to
"file". This comes into effect because of our adding of -rR to
MAKEFLAGS, which make 3.82 wrongly applies also upon re-invoking itself
after having updated auto.conf{,.cmd}.

Move the export statement past $(XEN_ROOT)/config/$(XEN_OS).mk inclusion
(which happens through $(XEN_ROOT)/Config.mk) such that the variables
already have their designated values at that point, while retaining
their initial origin up to the point they get defined.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Release-acked-by: Paul Durrant <paul@xen.org>
xen/Makefile