xen/build: use new $(c_flags) and $(a_flags) instead of $(CFLAGS)
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 23 Apr 2020 08:00:07 +0000 (10:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 Apr 2020 08:00:07 +0000 (10:00 +0200)
commit732571959f171638b5161c9ba0d557f7b6da74f4
tree0f74c587bd7f28556b8428b4ec3bd6c8fd1f2028
parent6c122d3984a5efb1f187cde0e478e4e346202f2b
xen/build: use new $(c_flags) and $(a_flags) instead of $(CFLAGS)

In a later patch ("xen/build: have the root Makefile generates the
CFLAGS), we want to generate the CFLAGS in xen/Makefile, then export
it and have Rules.mk use a CFLAGS from the environment variables. That
changes the flavor of the CFLAGS and flags intended for one target
(like -D__OBJECT_FILE__ and -M%) gets propagated and duplicated. So we
start by moving such flags out of $(CFLAGS) and into $(c_flags) which
is to be modified by only Rules.mk.

__OBJECT_FILE__ is only used by arch/x86/mm/*.c files, so having it in
$(c_flags) is enough, we don't need it in $(a_flags).

For include/Makefile and as-insn we can keep using CFLAGS, but since
it doesn't have -M* flags anymore there is no need to filter them out.

The XEN_BUILD_EFI tests in arch/x86/Makefile was filtering out
CFLAGS-y, but according to dd40177c1bc8 ("x86-64/EFI: add CFLAGS to
check compile"), it was done to filter out -MF. CFLAGS doesn't
have those flags anymore, so no filtering is needed.

This is inspired by the way Kbuild generates CFLAGS for each targets.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/Rules.mk
xen/arch/arm/Makefile
xen/arch/x86/Makefile
xen/arch/x86/mm/Makefile
xen/arch/x86/mm/hap/Makefile
xen/arch/x86/mm/shadow/Makefile
xen/include/Makefile