From nobody Mon Feb 9 16:18:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.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=1579258499; cv=none; d=zohomail.com; s=zohoarc; b=TaCP1wY53ox3g2CWPRCg0gzRjvWHQVS/FVlUABB61335r4Phe5YuRMXV0vVOC5PS/oD9HOAuua8wBH782QlHDW6JbHyrM8BJ7Kji4S7AMO2hMEfTQDrQDXo74Br3HcdqtYvP+zYgFTPEoEfqgzL5vZuykhcObIuS5X4NNyiKVpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579258499; 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=oBMQ0jWlY1f/MkczuweQ/82TJdeJPpLuk3hNoaCxF3U=; b=A7g3uq1D8Edn+GTpNfPAEjb5N8nq22S3jonhh3skQOb+1EoUO6DuckHjUKnWJeXr6dmFU8czo3bYzlF04LapuOi/WvguFwTcDYR1XXTC1cm2B1f2vRTkpl0Z6+dyfE0a7cv86B79IeRyoXSDVkYdphaw/SsVfgtBIXY8/0ycTjE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.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 1579258499846998.3754008160223; Fri, 17 Jan 2020 02:54:59 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1isPGY-0004rw-7Y; Fri, 17 Jan 2020 10:54:14 +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 1isPGW-0004rm-TO for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:12 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ad953898-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:05 +0000 (UTC) X-Inumbo-ID: ad953898-3917-11ea-88b0-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BaVL54Bogf22hBGa7/sAqmT8wuvNZRQ1/2NJj3UBFd0=; b=KAV/BxKfLKTkHA7ctSnpMFWvXBN+bFHq+iL3y/xtbwzxWDRK2UxyKRmv YySzaSYcxvo7TCl6Tcv+pRgK/jILPrYPMThR5JbNGUu9B4bbMpomwzEAt q1CQXdi3hzAkhyQBGgWewnxSTZ1TeR23rEnZV+nFvkgtzrcAs9+1ycMiA E=; Authentication-Results: esa5.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 (zohomail.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: CgK8RSRYP93o4sJcM7pfI3F88EkDAWf6XUZ2sXgXh1BlTfIMK0eb2ZRcjF4RVm1ENbtl8zFyxd soFOFNcYR8YpKCzxysRK+4ph0X/M3EAXUIpSyVJNQP5vtsdV7KTxBYk70D6vi57SgcHQnjFOpT /dTXfOK1WcQ6RejjSeKducrs5KgxVRYPkNOIfRNeGKiCreEso9xvG2AkpAPI1eDVot5TeL80fI ZYNGVDeRHwQwCAHbCb2PmuurLQWuF54cf0/6nyAsRIZep1kjKCnPYGp8ArdbxTGMC23FKnBQAU kNE= X-SBRS: 2.7 X-MesageID: 11432449 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432449" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:50 +0000 Message-ID: <20200117105358.607910-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 04/12] xen/build: extract clean target from Rules.mk 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: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Anthony PERARD , Jan Beulich , 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) From: Anthony PERARD Most of the code executed by Rules.mk isn't necessary for the clean target, especially not the CFLAGS. This make running make clean much faster. This extract the code into a different Makefile. It doesn't want to include Config.mk either so variables DEPS_RM and DEPS_INCLUDE are extracted from Config.mk as well. DEPS_INCLUDE is put into Kbuild.include so it could be use by other Makefiles. This is inspired by Kbuild, with Makefile.clean partially copied from Linux v5.4. Signed-off-by: Anthony PERARD --- xen/Rules.mk | 13 ------------- xen/scripts/Kbuild.include | 7 ++++++- xen/scripts/Makefile.clean | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 xen/scripts/Makefile.clean diff --git a/xen/Rules.mk b/xen/Rules.mk index 120323717d87..deab0abd63e1 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -94,8 +94,6 @@ LDFLAGS +=3D $(LDFLAGS-y) =20 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk =20 -DEPS =3D .*.d - include Makefile =20 define gendep @@ -113,11 +111,6 @@ __subdir-y :=3D $(filter %/, $(obj-y)) subdir-y +=3D $(__subdir-y) obj-y :=3D $(patsubst %/, %/built_in.o, $(obj-y)) =20 -subdir-n :=3D $(subdir-n) $(subdir-) \ - $(filter %/, $(obj-n) $(obj-)) - -subdir-all :=3D $(subdir-y) $(subdir-n) - $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS +=3D -DINIT_SE= CTIONS_ONLY =20 ifeq ($(CONFIG_COVERAGE),y) @@ -181,12 +174,6 @@ FORCE: %/built_in_bin.o: FORCE $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in_bin.o =20 -.PHONY: clean -clean:: $(addprefix _clean_, $(subdir-all)) - rm -f *.o .*.o.tmp *~ core $(DEPS_RM) -_clean_%/: FORCE - $(MAKE) $(clean) $* - SRCPATH :=3D $(patsubst $(BASEDIR)/%,%,$(CURDIR)) =20 %.o: %.c Makefile diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include index 2465cc4060c3..6a9b0c39da53 100644 --- a/xen/scripts/Kbuild.include +++ b/xen/scripts/Kbuild.include @@ -2,6 +2,11 @@ #### # kbuild: Generic definitions =20 +### +# dependencies +DEPS =3D .*.d +DEPS_INCLUDE =3D $(addsuffix .d2, $(basename $(wildcard $(DEPS)))) + # cc-ifversion # Usage: EXTRA_CFLAGS +=3D $(call cc-ifversion, -lt, 0402, -O1) cc-ifversion =3D $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $= (3) || echo $(4)) @@ -9,4 +14,4 @@ cc-ifversion =3D $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2= )000 ] && echo $(3) || e # Shorthand for $(MAKE) clean # Usage: # $(MAKE) $(clean) dir -clean :=3D -f $(BASEDIR)/Rules.mk clean -C +clean :=3D -f $(BASEDIR)/scripts/Makefile.clean clean -C diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean new file mode 100644 index 000000000000..31cf2b59594e --- /dev/null +++ b/xen/scripts/Makefile.clean @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: GPL-2.0 +# =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 +# Cleaning up +# =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 + +clean:: + +include $(BASEDIR)/scripts/Kbuild.include + +include Makefile + +# Figure out what we need to build from the various variables +# =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 +__subdir-y :=3D $(filter %/, $(obj-y)) +subdir-y +=3D $(__subdir-y) +subdir-n :=3D $(subdir-n) $(subdir-) \ + $(filter %/, $(obj-n) $(obj-)) +subdir-all :=3D $(subdir-y) $(subdir-n) + +DEPS_RM =3D $(DEPS) $(DEPS_INCLUDE) +.PHONY: clean +clean:: $(addprefix _clean_, $(subdir-all)) + rm -f *.o .*.o.tmp *~ core $(DEPS_RM) + +# Descending +# ------------------------------------------------------------------------= --- + +_clean_%/: FORCE + $(MAKE) $(clean) $* + +# Force execution of pattern rules (for which PHONY cannot be directly use= d). +.PHONY: FORCE +FORCE: --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel