diff mbox series

[XEN,v2,07/12] xen/build: run targets csopes, tags, .. without Rules.mk

Message ID 20200117105358.607910-8-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series xen: Build system improvements | expand

Commit Message

Anthony PERARD Jan. 17, 2020, 10:53 a.m. UTC
Those targets make use of $(all_sources) which depends on TARGET_ARCH,
so we just need to set TARGET_ARCH earlier and once.

XEN_TARGET_ARCH isn't expected to change during the build, so
TARGET_SUBARCH and TARGET_ARCH aren't going to change either. Set them
once and for all in the Xen root Makefile. This allow to run more
targets without Rules.mk.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Makefile | 25 +++++++++++++++----------
 xen/Rules.mk |  5 -----
 2 files changed, 15 insertions(+), 15 deletions(-)

Comments

Jan Beulich Jan. 30, 2020, 11:29 a.m. UTC | #1
On 17.01.2020 11:53, Anthony PERARD wrote:
> Those targets make use of $(all_sources) which depends on TARGET_ARCH,
> so we just need to set TARGET_ARCH earlier and once.
> 
> XEN_TARGET_ARCH isn't expected to change during the build, so
> TARGET_SUBARCH and TARGET_ARCH aren't going to change either.

In principle yes, but there's an exception which may be worth
mentioning here that it doesn't conflict: arch/x86/boot/build32.mk
overrides XEN_TARGET_ARCH (but doesn't use the remaining make
machinery).

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -35,6 +35,11 @@ SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
>  # we need XEN_TARGET_ARCH to generate the proper config
>  include $(XEN_ROOT)/Config.mk
>  
> +# Set ARCH/SUBARCH appropriately.
> +export TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
> +export TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
> +                            sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')

Seeing this, ...

> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -27,11 +27,6 @@ ifneq ($(origin verbose),undefined)
>  $(error "You must use 'make menuconfig' to enable/disable verbose now.")
>  endif
>  
> -# Set ARCH/SUBARCH appropriately.
> -override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
> -override TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
> -                              sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')

... where did the "override"s go?

Jan
diff mbox series

Patch

diff --git a/xen/Makefile b/xen/Makefile
index 814011175fd8..0e589de7755e 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -35,6 +35,11 @@  SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
 # we need XEN_TARGET_ARCH to generate the proper config
 include $(XEN_ROOT)/Config.mk
 
+# Set ARCH/SUBARCH appropriately.
+export TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
+export TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
+                            sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
+
 # Allow someone to change their config file
 export KCONFIG_CONFIG ?= .config
 
@@ -46,8 +51,8 @@  dist: install
 
 build install:: include/config/auto.conf
 
-.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags tests
-build install uninstall debug clean distclean cscope TAGS tags MAP gtags tests::
+.PHONY: build install uninstall clean distclean MAP tests
+build install uninstall debug clean distclean MAP tests::
 ifneq ($(XEN_TARGET_ARCH),x86_32)
 	$(MAKE) -f Rules.mk _$@
 else
@@ -220,25 +225,25 @@  endef
 xenversion:
 	@echo $(XEN_FULLVERSION)
 
-.PHONY: _TAGS
-_TAGS: 
+.PHONY: TAGS
+TAGS:
 	set -e; rm -f TAGS; \
 	$(call set_exuberant_flags,etags); \
 	$(all_sources) | xargs etags $$exuberant_flags -a
 
-.PHONY: _tags
-_tags: 
+.PHONY: tags
+tags:
 	set -e; rm -f tags; \
 	$(call set_exuberant_flags,ctags); \
 	$(all_sources) | xargs ctags $$exuberant_flags -a
 
-.PHONY: _gtags
-_gtags:
+.PHONY: gtags
+gtags:
 	set -e; rm -f GTAGS GSYMS GPATH GRTAGS
 	$(all_sources) | gtags -f -
 
-.PHONY: _cscope
-_cscope:
+.PHONY: cscope
+cscope:
 	$(all_sources) > cscope.files
 	cscope -k -b -q
 
diff --git a/xen/Rules.mk b/xen/Rules.mk
index deab0abd63e1..d20521cc9ec1 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -27,11 +27,6 @@  ifneq ($(origin verbose),undefined)
 $(error "You must use 'make menuconfig' to enable/disable verbose now.")
 endif
 
-# Set ARCH/SUBARCH appropriately.
-override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
-override TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
-                              sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
-
 TARGET := $(BASEDIR)/xen
 
 # Note that link order matters!