xen/build: include include/config/auto.conf in main Makefile
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 23 Apr 2020 07:59:27 +0000 (09:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 Apr 2020 07:59:27 +0000 (09:59 +0200)
commit6c122d3984a5efb1f187cde0e478e4e346202f2b
tree2dd4b9fc1b9261cbc9ff590710fec2354bd42f6d
parent52f3f319851e40892fbafeae53e512c7d61f03d0
xen/build: include include/config/auto.conf in main Makefile

We are going to generate the CFLAGS early from "xen/Makefile" instead
of in "Rules.mk", but we need to include "config/auto.conf", so
include it in "Makefile".

Before including "config/auto.conf" we check which make target a user
is calling, as some targets don't need "auto.conf". For targets that
needs auto.conf, make will generate it (and a default .config if
missing).

root-make-done is to avoid doing the calculation again once Rules.mk
takes over and is been executed with the root Makefile. When Rules.mk
is including xen/Makefile, `config-build' and `need-config' are
undefined so auto.conf will not be included again (it is already
included by Rules.mk) and kconfig target are out of reach of Rules.mk.

We are introducing a target %config to catch all targets for kconfig.
So we need an extra target %/.config to prevent make from trying to
regenerate $(XEN_ROOT)/.config that is included in Config.mk.

The way targets are filtered is inspired by Kbuild, with some code
imported from Linux. That's why there is PHONY variable that isn't
used yet, for example.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/Makefile