From nobody Tue Feb 10 01:35:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1571850707; cv=none; d=zoho.com; s=zohoarc; b=Oq1QPArC36pxplE7xLoFLSg6TFORL7gMAXXT97V4ARo5QU3RUzFxncEee8mm5Qj3XuximFQeB23oM/pGljH8gvMEC3CURM17X3N9HzIonp+Dj4FIWkShDGVbHNOsHVpuQmu4lMLYiSKsELcoPa6FZUgJHhIuTBX1WRTbcGV93KA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571850707; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LCtlTOcU7Oje8n8EJU+EIx1EqYmGUIRov4n2S2trzOQ=; b=DLpRdy5mQO5IBdu6nNe8LLW/PuOrIvfV/7Yi9iKuY8jJLJiP6QHDucWhJ+Wn84R4WCQiySJ79fpzav93/AlboCq4c1T9kkA1+TcW2G/ixIe3qB4C1YKSHBm7UudeCCluWbouD5H73wZ4AGZcNHL8+DB4cFg81XoqtPpNzba9N/k= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1571850707767666.3076174299836; Wed, 23 Oct 2019 10:11:47 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNK9i-0002aH-6X; Wed, 23 Oct 2019 17:10:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNK9g-0002Zt-L5 for xen-devel@lists.xenproject.org; Wed, 23 Oct 2019 17:10:40 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 067caf3e-f5b8-11e9-9488-12813bfff9fa; Wed, 23 Oct 2019 17:10:34 +0000 (UTC) X-Inumbo-ID: 067caf3e-f5b8-11e9-9488-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1571850635; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=o9iR+NN3wy+FNjUXt4ByoVwhjsassX4g+IHSZsUVaEc=; b=hf94xfmfIjA0B0of4b9rzbTw7paFx4Bp7/TDgNznMLOzQkJwjyrOZRG0 9A7FWvxbemZH1/gQWW8/qgrd+a8pCUWdZEFDFDHPvvmRFDoofq3gKlwKl ANdF4U6SyVEUvQ1e5nOMPdysHgfwFSamgvy/oq9sfue5f313ZMmK9pZQc Q=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: MffVZ1XEehJjAUDDBhM3nQTPpOie2eNmkiyP7zuKPM9EqWxJQzz5VFUv4/Mdm0RtjBvIsVy/CK yBiotQJE3HN3g19HmfcXZgwcLAJarCfNHdySfh1o8XfNTOxqNzDw34SPsVfhuzpZpoFRFACYax fLjOEciAfHJICJdqhhLDK2bZpN25hw1cbCsw/1wRDp6TMC41kXx9DGx8qs6U/Fy0DMyyRuW6KK mxA8podGBuK3t5a4elHGEKEHCMCP2MMu3JdtHAHkG8RAbrYsub8H20QTrvBjaxIlOifJmKJ8bp ao4= X-SBRS: 2.7 X-MesageID: 7429236 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.68,221,1569297600"; d="scan'208";a="7429236" From: Anthony PERARD To: Date: Wed, 23 Oct 2019 17:48:36 +0100 Message-ID: <20191023164837.2700240-23-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191023164837.2700240-1-anthony.perard@citrix.com> References: <20191023164837.2700240-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [RFC XEN PATCH 22/23] Changes to root Makefile X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) - *FLAGS - fix path to Kconfig - List objects to build - generate include/xen/compile.h - make prepare phase - changes to clean - remove build of kernel.version --- xen/Makefile | 263 ++++++++++++++++++++++++++++----------------------- 1 file changed, 143 insertions(+), 120 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 90645668957c..66448b067eb0 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -13,8 +13,6 @@ export XEN_BUILD_DATE ?=3D $(shell LC_ALL=3DC date) export XEN_BUILD_TIME ?=3D $(shell LC_ALL=3DC date +%T) export XEN_BUILD_HOST ?=3D $(shell hostname) =20 -export XEN_ROOT :=3D $(CURDIR)/.. - # *DOCUMENTATION* # To see a list of typical targets execute "make help" # More info can be located in ./README @@ -238,8 +236,10 @@ endif =20 objtree :=3D . VPATH :=3D $(srctree) +XEN_ROOT :=3D $(abs_srctree)/.. =20 export building_out_of_srctree srctree objtree VPATH +export XEN_ROOT =20 # To make sure we do not include .config for any of the *config targets # catch them early, and hand them over to scripts/kconfig/Makefile @@ -316,6 +316,15 @@ else =20 include scripts/Kbuild.include =20 +# XXX From Config.mk +XEN_COMPILE_ARCH ?=3D $(shell uname -m | sed -e s/i.86/x86_32/ \ + -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \ + -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \ + -e s/aarch64/arm64/) +XEN_TARGET_ARCH ?=3D $(XEN_COMPILE_ARCH) +XEN_OS ?=3D $(shell uname -s) +export XEN_OS + # Cross compiling and selecting different set of gcc/bin-utils # ------------------------------------------------------------------------= --- # @@ -334,7 +343,7 @@ include scripts/Kbuild.include # Alternatively CROSS_COMPILE can be set in the environment. # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile -ARCH ?=3D $(SUBARCH) +ARCH ?=3D $(XEN_COMPILE_ARCH) SRCARCH :=3D $(shell echo $(XEN_TARGET_ARCH) | \ sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/ar= m/g') =20 @@ -363,6 +372,7 @@ KBUILD_HOSTLDLIBS :=3D $(HOST_LFS_LIBS) $(HOSTLDLIBS) AS =3D $(CROSS_COMPILE)as LD =3D $(CROSS_COMPILE)ld CC =3D $(CROSS_COMPILE)gcc +CXX =3D $(CROSS_COMPILE)g++ CPP =3D $(CC) -E AR =3D $(CROSS_COMPILE)ar NM =3D $(CROSS_COMPILE)nm @@ -385,7 +395,7 @@ CHECKFLAGS :=3D -D__linux__ -Dlinux -D__STDC__ -Dun= ix -D__unix__ \ NOSTDINC_FLAGS :=3D CFLAGS_KERNEL =3D AFLAGS_KERNEL =3D -LDFLAGS_vmlinux =3D +LDFLAGS_xen =3D =20 # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O=3D option @@ -395,13 +405,35 @@ LINUXINCLUDE :=3D \ =20 KBUILD_AFLAGS :=3D -D__ASSEMBLY__ -fno-PIE KBUILD_CFLAGS :=3D + +# XXX CFLAGS found in xen.git/config/$(XEN_TARGET_ARCH).mk +KBUILD_CFLAGS +=3D -m64 +# XXX CFLAGS found in Config.mk +export XEN_HAS_BUILD_ID ?=3D n +ifeq ($(call ld-option,--build-id),) +build_id_linker :=3D +else +KBUILD_CFLAGS +=3D -DBUILD_ID +export XEN_HAS_BUILD_ID=3Dy +build_id_linker :=3D --build-id=3Dsha1 +# possible improvement: LDFLAGS_xen-syms :=3D --build-id=3Dsha1 +endif +export build_id_linker +KBUILD_CFLAGS +=3D -fno-strict-aliasing -std=3Dgnu99 -Wall -Wstrict-protot= ypes +KBUILD_CFLAGS +=3D $(call cc-option,-Wdeclaration-after-statement) +KBUILD_CFLAGS +=3D $(call cc-disable-warning,unused-but-set-variable) +KBUILD_CFLAGS +=3D $(call cc-disable-warning,unused-local-typedefs) + +EMBEDDED_EXTRA_CFLAGS :=3D -nopie -fno-stack-protector -fno-stack-protecto= r-all +EMBEDDED_EXTRA_CFLAGS +=3D -fno-exceptions + KBUILD_CPPFLAGS :=3D KBUILD_LDFLAGS :=3D GCC_PLUGINS_CFLAGS :=3D CLANG_FLAGS :=3D =20 export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS= LD CC -export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK +export CXX CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE HOSTCXX export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS =20 @@ -469,7 +501,7 @@ CC_VERSION_TEXT =3D $(shell $(CC) --version 2>/dev/null= | head -n 1) ifeq ($(config-targets),1) # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D # *config targets only - make sure prerequisites are updated, and descend -# in scripts/kconfig to make the *config target +# in tools/kconfig to make the *config target =20 # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. # KBUILD_DEFCONFIG may point out an alternative default configuration @@ -478,10 +510,10 @@ include arch/$(SRCARCH)/Makefile export KBUILD_DEFCONFIG KBUILD_KCONFIG CC_VERSION_TEXT =20 config: scripts_basic outputmakefile FORCE - $(Q)$(MAKE) $(build)=3Dscripts/kconfig $@ + $(Q)$(MAKE) $(build)=3Dtools/kconfig $@ =20 %config: scripts_basic outputmakefile FORCE - $(Q)$(MAKE) $(build)=3Dscripts/kconfig $@ + $(Q)$(MAKE) $(build)=3Dtools/kconfig $@ =20 else # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D @@ -501,23 +533,18 @@ ifeq ($(dot-config),1) include include/config/auto.conf endif =20 -ifeq ($(KBUILD_EXTMOD),) -# Objects we will link into vmlinux / subdirs we need to visit -init-y :=3D init/ -drivers-y :=3D drivers/ sound/ -drivers-$(CONFIG_SAMPLES) +=3D samples/ -drivers-$(CONFIG_KERNEL_HEADER_TEST) +=3D include/ -net-y :=3D net/ -libs-y :=3D lib/ -core-y :=3D usr/ -virt-y :=3D virt/ -endif # KBUILD_EXTMOD +# Objects we will link into xen / subdirs we need to visit +common-y :=3D common/ +drivers-y :=3D drivers/ +libs-$(CONFIG_X86) :=3D lib/ +xsm-y :=3D xsm/ +arch-y :=3D arch/$(SRCARCH)/ +crypto-$(CONFIG_CRYPTO) :=3D crypto/ =20 # The all: target is the default when no target is given on the # command line. -# This allow a user to issue only 'make' to build a kernel including modul= es -# Defaults to vmlinux, but the arch makefile usually adds further targets -all: vmlinux +# Defaults to xen, but the arch makefile usually adds further targets +all: xen =20 CFLAGS_GCOV :=3D -fprofile-arcs -ftest-coverage \ $(call cc-option,-fno-tree-loop-im) \ @@ -552,14 +579,9 @@ ifeq ($(may-sync-config),1) # because some architectures define CROSS_COMPILE there. include include/config/auto.conf.cmd =20 +# Allow people to just run `make` as before and not force them to configure $(KCONFIG_CONFIG): - @echo >&2 '***' - @echo >&2 '*** Configuration file "$@" not found!' - @echo >&2 '***' - @echo >&2 '*** Please run some configurator (e.g. "make oldconfig" or' - @echo >&2 '*** "make menuconfig" or "make xconfig").' - @echo >&2 '***' - @/bin/false + $(Q)$(MAKE) -f $(srctree)/Makefile defconfig =20 # The actual configuration files used during the build are stored in # include/generated/ and include/config/. Update them if .config is newer = than @@ -587,15 +609,40 @@ include/config/auto.conf: endif # may-sync-config endif # $(dot-config) =20 +# XXX CFLAGS found in Rules.mk +ifeq ($(CONFIG_DEBUG),y) +KBUILD_CFLAGS +=3D -O1 +else +KBUILD_CFLAGS +=3D -O2 +endif =20 -# arch Makefile may override CC so keep this after arch Makefile is includ= ed -NOSTDINC_FLAGS +=3D -nostdinc -isystem $(shell $(CC) -print-file-name=3Din= clude) +ifeq ($(CONFIG_FRAME_POINTER),y) +KBUILD_CFLAGS +=3D -fno-omit-frame-pointer +else +KBUILD_CFLAGS +=3D -fomit-frame-pointer +endif =20 +KBUILD_CFLAGS +=3D -fno-builtin -fno-common +KBUILD_CFLAGS +=3D -Werror -Wredundant-decls -Wno-pointer-arith +KBUILD_CFLAGS +=3D $(call cc-option,-Wvla) +KBUILD_CFLAGS +=3D -pipe -D__XEN__ -include $(srctree)/include/xen/config.h +ifeq ($(CONFIG_DEBUG_INFO),y) +KBUILD_CFLAGS +=3D -g +endif =20 +KBUILD_CFLAGS +=3D -Wa,--strip-local-absolute + +# arch Makefile may override CC so keep this after arch Makefile is includ= ed +NOSTDINC_FLAGS +=3D -nostdinc =20 # use the deterministic mode of AR if available KBUILD_ARFLAGS :=3D $(call ar-option,D) =20 +# Most CFLAGS are safe for assembly files: +# -std=3Dgnu{89,99} gets confused by #-prefixed end-of-line comments +# -flto makes no sense and annoys clang +KBUILD_AFLAGS +=3D $(filter-out -std=3Dgnu% -flto,$(KBUILD_CFLAGS)) + include scripts/Makefile.kasan include scripts/Makefile.ubsan =20 @@ -616,7 +663,7 @@ CHECKFLAGS +=3D $(if $(CONFIG_64BIT),-m64,-m32) # set in the environment # Also any assignments in arch/$(ARCH)/Makefile take precedence over # this default value -export KBUILD_IMAGE ?=3D vmlinux +export KBUILD_IMAGE ?=3D xen =20 # # INSTALL_PATH specifies where to place the updated kernel and system map @@ -627,74 +674,59 @@ HOST_LIBELF_LIBS =3D $(shell pkg-config libelf --libs= 2>/dev/null || echo -lelf) =20 PHONY +=3D prepare0 =20 -core-y +=3D kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ +xen-dirs :=3D $(patsubst %/,%,$(filter %/, $(head-y) $(common-y) \ + $(drivers-y) $(libs-y) $(xsm-y) $(arch-y) \ + $(crypto-y))) =20 -vmlinux-dirs :=3D $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ - $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ - $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y))) +xen-alldirs :=3D $(sort $(xen-dirs) \ + $(patsubst %/,%,$(filter %/, $(head-y) $(common-) \ + $(drivers-) $(libs-) $(xsm-) $(arch-) $(crypto-)))) +xen-alldirs +=3D include =20 -vmlinux-alldirs :=3D $(sort $(vmlinux-dirs) Documentation \ - $(patsubst %/,%,$(filter %/, $(init-) $(core-) \ - $(drivers-) $(net-) $(libs-) $(virt-)))) - -init-y :=3D $(patsubst %/, %/built-in.a, $(init-y)) -core-y :=3D $(patsubst %/, %/built-in.a, $(core-y)) +head-y :=3D $(patsubst %/, %/built-in.a, $(head-y)) +common-y :=3D $(patsubst %/, %/built-in.a, $(common-y)) drivers-y :=3D $(patsubst %/, %/built-in.a, $(drivers-y)) -net-y :=3D $(patsubst %/, %/built-in.a, $(net-y)) libs-y1 :=3D $(patsubst %/, %/lib.a, $(libs-y)) libs-y2 :=3D $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y))) -virt-y :=3D $(patsubst %/, %/built-in.a, $(virt-y)) +xsm-y :=3D $(patsubst %/, %/built-in.a, $(xsm-y)) +arch-y :=3D $(patsubst %/, %/built-in.a, $(arch-y)) +crypto-y :=3D $(patsubst %/, %/built-in.a, $(crypto-y)) =20 -# Externally visible symbols (used by link-vmlinux.sh) -export KBUILD_VMLINUX_OBJS :=3D $(head-y) $(init-y) $(core-y) $(libs-y2) \ - $(drivers-y) $(net-y) $(virt-y) +# Externally visible symbols +export ALL_OBJS :=3D $(head-y) $(common-y) $(drivers-y) $(libs-= y2) \ + $(xsm-y) $(arch-y) $(crypto-y) export KBUILD_VMLINUX_LIBS :=3D $(libs-y1) -export KBUILD_LDS :=3D arch/$(SRCARCH)/kernel/vmlinux.lds -export LDFLAGS_vmlinux -# used by scripts/package/Makefile -export KBUILD_ALLDIRS :=3D $(sort $(filter-out arch/%,$(vmlinux-alldirs)) = LICENSES arch include scripts tools) - -vmlinux-deps :=3D $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LI= BS) - -ARCH_POSTLINK :=3D $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) +export KBUILD_LDS :=3D arch/$(SRCARCH)/xen.lds +export LDFLAGS_xen +export TARGET :=3D xen =20 -# Final link of vmlinux with optional arch pass after final link -cmd_link-vmlinux =3D \ - $(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \ - $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) +xen-deps :=3D $(KBUILD_LDS) $(ALL_OBJS) $(KBUILD_VMLINUX_LIBS) =20 -vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE - +$(call if_changed,link-vmlinux) +xen: $(xen-deps) FORCE + $(Q)$(MAKE) $(build)=3Darch/$(SRCARCH) xen =20 -targets :=3D vmlinux +targets :=3D xen =20 # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(vmlinux-deps)): $(vmlinux-dirs) ; +$(sort $(xen-deps)): $(xen-dirs) ; =20 -# Handle descending into subdirectories listed in $(vmlinux-dirs) +# Handle descending into subdirectories listed in $(xen-dirs) # Preset locale variables to speed up the build process. Limit locale # tweaks to this spot to avoid wrong language settings when running # make menuconfig etc. # Error messages still appears in the original language =20 -PHONY +=3D $(vmlinux-dirs) -$(vmlinux-dirs): prepare +PHONY +=3D $(xen-dirs) +$(xen-dirs): prepare $(Q)$(MAKE) $(build)=3D$@ need-builtin=3D1 need-modorder=3D1 =20 -filechk_kernel.release =3D \ - echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversi= on $(srctree))" - -# Store (new) KERNELRELEASE string in include/config/kernel.release -include/config/kernel.release: FORCE - $(call filechk,kernel.release) - # Additional helpers built in scripts/ # Carefully list dependencies so we do not try to build scripts twice # in parallel PHONY +=3D scripts -scripts: scripts_basic scripts_dtc - $(Q)$(MAKE) $(build)=3D$(@) +scripts: scripts_basic + $(Q)$(MAKE) $(build)=3Dtools =20 # Things we need to do before we recursively start building the kernel # or the modules are listed in "prepare". @@ -707,7 +739,7 @@ PHONY +=3D prepare archprepare prepare3 # prepare3 is used to check if we are building in a separate output direct= ory, # and if so do: # 1) Check that make has not been executed in the kernel src $(srctree) -prepare3: include/config/kernel.release +prepare3: ifdef building_out_of_srctree @$(kecho) ' Using $(srctree) as source for kernel' $(Q)if [ -f $(srctree)/.config -o \ @@ -719,11 +751,15 @@ ifdef building_out_of_srctree fi; endif =20 -archprepare: archheaders archscripts scripts prepare3 outputmakefile \ - asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h +PHONY +=3D preprepare +preprepare: + $(Q)[ -e $(objtree)/include/asm ] || ln -sf asm-$(SRCARCH) $(objtree)/inc= lude/asm + $(Q)$(MAKE) $(build)=3Dinclude all + +archprepare: preprepare archheaders scripts prepare3 outputmakefile \ + $(version_h) =20 prepare0: archprepare - $(Q)$(MAKE) $(build)=3Dscripts/mod $(Q)$(MAKE) $(build)=3D. =20 # All the preparing.. @@ -732,73 +768,63 @@ prepare: prepare0 # Generate some files # ------------------------------------------------------------------------= --- =20 -# KERNELRELEASE can change from a few different places, meaning version.h +# KERNELRELEASE can change from a few different places, meaning compile.h # needs to be updated, so this check is forced on all builds =20 -uts_len :=3D 64 -define filechk_utsrelease.h - if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ - echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ - exit 1; \ - fi; \ - echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" -endef - +# compile.h contains dynamic build info. Rebuilt on every 'make' invocatio= n. define filechk_version.h - echo \#define LINUX_VERSION_CODE $(shell \ - expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \ - echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' + echo '#define XEN_COMPILE_DATE "$(XEN_BUILD_DATE)"'; \ + echo '#define XEN_COMPILE_TIME "$(XEN_BUILD_TIME)"'; \ + echo '#define XEN_COMPILE_BY "$(XEN_WHOAMI)"'; \ + echo '#define XEN_COMPILE_DOMAIN "$(XEN_DOMAIN)"'; \ + echo '#define XEN_COMPILE_HOST "$(XEN_BUILD_HOST)"'; \ + echo '#define XEN_COMPILER "$(shell $(CC) $(KBUILD_CFLAGS) --version 2>&= 1 | head -1)"'; \ + echo; \ + echo '#define XEN_VERSION $(XEN_VERSION)'; \ + echo '#define XEN_SUBVERSION $(XEN_SUBVERSION)'; \ + echo '#define XEN_EXTRAVERSION "$(XEN_EXTRAVERSION)"'; \ + echo; \ + echo '#define XEN_CHANGESET "$(shell tools/scmversion $(XEN_ROOT) || ech= o "unavailable")"'; \ + echo '#define XEN_BANNER "Xen $(XEN_FULLVERSION)"' endef =20 $(version_h): FORCE $(call filechk,version.h) - $(Q)rm -f $(old_version_h) =20 ### # Cleaning is done on three levels. # make clean Delete most generated files -# Leave enough to build external modules # make mrproper Delete the current configuration, and all generated files # make distclean Remove editor backup files, patch leftover files and the = like =20 # Directories & files removed with 'make clean' -CLEAN_DIRS +=3D include/ksym -CLEAN_FILES +=3D modules.builtin.modinfo =20 # Directories & files removed with 'make mrproper' MRPROPER_DIRS +=3D include/config include/generated \ - arch/$(SRCARCH)/include/generated .tmp_objdiff -MRPROPER_FILES +=3D .config .config.old .version \ - Module.symvers \ - signing_key.pem signing_key.priv signing_key.x509 \ - x509.genkey extra_certificates signing_key.x509.keyid \ - signing_key.x509.signer vmlinux-gdb.py + arch/$(SRCARCH)/include/generated +MRPROPER_FILES +=3D .config .config.old include/asm =20 # Directories & files removed with 'make distclean' DISTCLEAN_DIRS +=3D DISTCLEAN_FILES +=3D tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS =20 -# clean - Delete most, but leave enough to build external modules +# clean - Delete most # clean: rm-dirs :=3D $(CLEAN_DIRS) clean: rm-files :=3D $(CLEAN_FILES) -clean-dirs :=3D $(addprefix _clean_, . $(vmlinux-alldirs)) +clean-dirs :=3D $(addprefix _clean_, . $(xen-alldirs)) =20 -PHONY +=3D $(clean-dirs) clean archclean vmlinuxclean +PHONY +=3D $(clean-dirs) clean archclean $(clean-dirs): $(Q)$(MAKE) $(clean)=3D$(patsubst _clean_%,%,$@) =20 -vmlinuxclean: - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean - $(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean) - -clean: archclean vmlinuxclean +clean: archclean =20 # mrproper - Delete all generated files, including .config # mrproper: rm-dirs :=3D $(wildcard $(MRPROPER_DIRS)) mrproper: rm-files :=3D $(wildcard $(MRPROPER_FILES)) -mrproper-dirs :=3D $(addprefix _mrproper_,scripts) +mrproper-dirs :=3D $(addprefix _mrproper_,tools) =20 PHONY +=3D $(mrproper-dirs) mrproper $(mrproper-dirs): @@ -842,7 +868,7 @@ help: @echo ' distclean - mrproper + remove editor backup and patch files' @echo '' @echo 'Configuration targets:' - @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help + @$(MAKE) -f $(srctree)/tools/kconfig/Makefile help @echo '' @echo 'Other generic targets:' @echo ' all - Build all targets marked with [*]' @@ -950,17 +976,14 @@ $(help-board-dirs): help-%: clean: $(clean-dirs) $(call cmd,rmdirs) $(call cmd,rmfiles) - @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ - \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \ - -o -name '*.ko.*' \ - -o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ - -o -name '*.dwo' -o -name '*.lst' \ + @find . $(RCS_FIND_IGNORE) \ + \( -name '*.[aios]' -o -name '.*.cmd' \ + -o -name '*.dwo' \ -o -name '*.su' -o -name '*.mod' \ - -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ + -o -name '.*.d' -o -name '.*.tmp' \ -o -name '*.lex.c' -o -name '*.tab.[ch]' \ -o -name '*.asn1.[ch]' \ - -o -name '*.symtypes' -o -name 'modules.order' \ - -o -name modules.builtin -o -name '.tmp_*.o.*' \ + -o -name '.tmp_*.o.*' \ -o -name '*.c.[012]*.*' \ -o -name '*.ll' \ -o -name '*.gcno' \) -type f -print | xargs rm -f --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel