From nobody Fri Nov 29 15:34:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1637848098; cv=none; d=zohomail.com; s=zohoarc; b=DZRwf27aqPfNXs0qC+JddOYb21ywZlLT60mAKvYag0xNgIBeW12L+XYq1NvUfK7Fv0vUmn5Y4c/7KeS66PHc1MoLHynf6TwrjXTA8Gm/sDbgUxLWpxFDtfSrMwWKlEigjWeAarCYpN95c8Do6OC3H5+fxq8PH109lB/PYnWH8zU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637848098; 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=kvETx9EwtEBeuppA52WCnmCZVhdbkhWKUzATGp6z01A=; b=ZDET0Zcw4RiuHhF1e0Os839Yx6WML13D5ZwiO+eZw563tq9xLsUhp/1nODt++1UGeg7BbCiFlXtWBW/0xMjBNfkzX6vdVjYrdjOAoo1pdfFWtoNHKcGXsEYNCP9jSNn4EZXBZdCjhQJUru3hTswT1RO3lTgWd9olTQo/gfpCYhQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1637848098295337.8322105018751; Thu, 25 Nov 2021 05:48:18 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.231308.400333 (Exim 4.92) (envelope-from ) id 1mqF6P-0000eI-Kp; Thu, 25 Nov 2021 13:47:53 +0000 Received: by outflank-mailman (output) from mailman id 231308.400333; Thu, 25 Nov 2021 13:47:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqF6O-0000ZX-IM; Thu, 25 Nov 2021 13:47:52 +0000 Received: by outflank-mailman (input) for mailman id 231308; Thu, 25 Nov 2021 13:47:51 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqF0A-0007NX-5Z for xen-devel@lists.xenproject.org; Thu, 25 Nov 2021 13:41:26 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 611e7cb7-4df5-11ec-9787-a32c541c8605; Thu, 25 Nov 2021 14:41:24 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 611e7cb7-4df5-11ec-9787-a32c541c8605 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1637847684; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ObpVRqOSVUZVbZvKGeecU4tcVcjIvrlnjGlAoQ30NGE=; b=Qza5s+vYB9/u2LpE52KTQkcRfYF3dwZlEMDW7RJ4Wfe3PHyd4IXWOL/c l/i2ihkEFR/Bez+xV/kH9IPF2tv7Na7R9dbdzx7XYsN7rT3LUxURZqYhZ qEuUb57u9z0PYB7T+aETLtd3iTIC8RdBBTtdoIDgxY36fJ3uHc6xlx3vG A=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: +CeJllXYb1/n54e25C6MAweqAlhFeSD7maoeJInops44rxq6go37uZC2dOpOjSJEWlgGnnFetu 9TA13vmjsvW8f9hZ7VsZECaUDD/FHT+slYZ8SBJGa6ZBPeVB3h76WWI21iRBJtnMT13i4Dg/qW VG/RzdN/76vEpt1ddGleD2BBx+guR0yWhGeaB01eD5Za8HwWcaM+vnoGo/dHh40YS3pMXeyRxr RlynoO7Tx3OF8YNBvvBIf8Wff8Eu6kublz9H8Q0IcYA3MIsaM1c+ArsfBg60D2lb8tMD9ddZe/ U0RW3h9/U3xonQVQ3U5M2TL+ X-SBRS: 5.1 X-MesageID: 58135473 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:bY3KEql69tpLo1WFVlKqWFjo5gz/IERdPkR7XQ2eYbSJt1+Wr1Gzt xIXCjuPa/yKMGuhfIxwOovkpBlUvJSDyd5hHAY5pS5jESMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BClVlxJVF/fngqoDUUYYoAQgsA187IMsdoUg7wbdg29Q12YLR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1yD92Yj+tuu6TnkTn2dc+NyDW4pZdc/DKbhSvOkXee0v0XRYRQR4/ttmHozx+4 Ilsn82LCh4xB7znh+QWdQVyATphIrITrdcrIVDn2SCS50jPcn+qyPRyFkAme4Yf/46bA0kXq 6ZecmpUKEne2aTmm9pXScE17ignBMDtIIMYvGAm1TzDBOwqaZvCX7/L9ZlT2zJYasVmQKaHP JdFNmEHgBLoSjBqH1keCYoCtb2xhELGWA12hFuVnP9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w4m6lBeepiAWCX4146CNodXOU4wL z7K2Keb3+ZAxlDPemYYHGTW2bYPnowHvR1HwQNQJ1mNndaZ1PY70AcIrGYyRwVRiB5Gz/hyK i5gMEgsffeC+DJhhc5iWWGwGl4eWE3FqxKpk1ZZxnfES0SIV3DWKDxvMOmAy0kV7mZAc2UJ5 7qf0mvkDW7nccyZMvHegqK5RygPleBMyzA= IronPort-HdrOrdr: A9a23:phGQ26xlNbIkAKNOYXLnKrPwFL1zdoMgy1knxilNoRw8SKKlfq eV7ZImPH7P+U4ssR4b+exoVJPtfZqYz+8R3WBzB8bEYOCFghrKEGgK1+KLqFeMJ8S9zJ846U 4JSdkGNDSaNzlHZKjBjzVQa+xQouW6zA== X-IronPort-AV: E=Sophos;i="5.87,263,1631592000"; d="scan'208";a="58135473" From: Anthony PERARD To: CC: Anthony PERARD , Andrew Cooper , George Dunlap , "Ian Jackson" , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Volodymyr Babchuk , "Bertrand Marquis" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Konrad Rzeszutek Wilk , "Ross Lagerwall" , Daniel De Graaf , "Daniel P. Smith" Subject: [XEN PATCH v8 23/47] build: rework "clean" to clean from the root dir Date: Thu, 25 Nov 2021 13:39:42 +0000 Message-ID: <20211125134006.1076646-24-anthony.perard@citrix.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211125134006.1076646-1-anthony.perard@citrix.com> References: <20211125134006.1076646-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1637848100320100001 Content-Type: text/plain; charset="utf-8" This will allow "clean" to work from an out-of-tree build when it will be available. Some of the file been removed in current "clean" target aren't added to $(clean-files) because they are already listed in $(extra-) or $(extra-y). Also start to clean files listed in $(targets). This allows to clean "common/config_data.S" and "xsm/flask/flask-policy.S" without having to list them a second time. Also clean files in "arch/x86/boot" from that directory by allowing "clean" to descend into the subdir by adding "boot" into $(subdir-). Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- Notes: v8: - fix comment for the shorthand - move this patch earlier in the series - replace some BASEDIR by objtree - start to clean $(targets) files. xen/Makefile | 24 ++++++++++++------------ xen/arch/arm/Makefile | 5 +---- xen/arch/x86/Makefile | 20 ++++++++++++-------- xen/arch/x86/boot/Makefile | 2 ++ xen/common/Makefile | 3 +-- xen/include/Makefile | 4 +--- xen/scripts/Kbuild.include | 4 ++-- xen/scripts/Makefile.clean | 14 +++++++++++--- xen/test/livepatch/Makefile | 4 +--- xen/xsm/flask/Makefile | 4 +--- 10 files changed, 44 insertions(+), 40 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 86bcedd7fa5b..deae319c8a5a 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -412,18 +412,18 @@ _debug: =20 .PHONY: _clean _clean: - $(MAKE) $(clean) tools - $(MAKE) $(clean) include - $(MAKE) $(clean) common - $(MAKE) $(clean) drivers - $(MAKE) $(clean) lib - $(MAKE) $(clean) xsm - $(MAKE) $(clean) crypto - $(MAKE) $(clean) arch/arm - $(MAKE) $(clean) arch/riscv - $(MAKE) $(clean) arch/x86 - $(MAKE) $(clean) test - $(MAKE) $(clean) tools/kconfig + $(Q)$(MAKE) $(clean)=3Dtools + $(Q)$(MAKE) $(clean)=3Dinclude + $(Q)$(MAKE) $(clean)=3Dcommon + $(Q)$(MAKE) $(clean)=3Ddrivers + $(Q)$(MAKE) $(clean)=3Dlib + $(Q)$(MAKE) $(clean)=3Dxsm + $(Q)$(MAKE) $(clean)=3Dcrypto + $(Q)$(MAKE) $(clean)=3Darch/arm + $(Q)$(MAKE) $(clean)=3Darch/riscv + $(Q)$(MAKE) $(clean)=3Darch/x86 + $(Q)$(MAKE) $(clean)=3Dtest + $(Q)$(MAKE) $(clean)=3Dtools/kconfig find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \ -o -name ".*.o.tmp" -o -name "*~" -o -name "core" \ -o -name '*.lex.c' -o -name '*.tab.[ch]' \ diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 3ce5f1674f6f..cecfaf4f3c0f 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -116,7 +116,4 @@ $(obj)/xen.lds: $(src)/xen.lds.S FORCE =20 $(obj)/dtb.o: $(patsubst "%",%,$(CONFIG_DTB_FILE)) =20 -.PHONY: clean -clean:: - rm -f $(obj)/xen.lds - rm -f $(BASEDIR)/.xen-syms.[0-9]* +clean-files :=3D $(objtree)/.xen-syms.[0-9]* diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 0b0ef6205bc1..243ca17f701e 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -77,6 +77,9 @@ obj-$(CONFIG_COMPAT) +=3D x86_64/platform_hypercall.o obj-y +=3D sysctl.o endif =20 +# Allows "clean" to descend into boot/ +subdir- +=3D boot + extra-y +=3D asm-macros.i extra-y +=3D xen.lds =20 @@ -190,8 +193,8 @@ note_file :=3D endif note_file_option ?=3D $(note_file) =20 +extra-$(XEN_BUILD_PE) +=3D efi.lds ifeq ($(XEN_BUILD_PE),y) -extra-y +=3D efi.lds $(TARGET).efi: $(BASEDIR)/prelink.o $(note_file) $(obj)/efi.lds $(obj)/efi= /relocs-dummy.o $(obj)/efi/mkreloc ifeq ($(CONFIG_DEBUG_INFO),y) $(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug inf= o from $(@F)" @@ -256,10 +259,11 @@ $(obj)/boot/mkelf32: $(src)/boot/mkelf32.c $(obj)/efi/mkreloc: $(src)/efi/mkreloc.c $(HOSTCC) $(HOSTCFLAGS) -g -o $@ $< =20 -.PHONY: clean -clean:: - rm -f *.lds boot/mkelf32 - rm -f asm-macros.i $(BASEDIR)/arch/x86/include/asm/asm-macros.* - rm -f $(BASEDIR)/.xen-syms.[0-9]* $(BASEDIR)/.xen.elf32 - rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/mkreloc - rm -f boot/cmdline.S boot/reloc.S boot/*.lnk boot/*.bin +clean-files :=3D \ + boot/mkelf32 \ + include/asm/asm-macros.* \ + $(objtree)/.xen-syms.[0-9]* \ + $(objtree)/.xen.elf32 \ + $(objtree)/.xen.efi.[0-9]* \ + efi/*.efi \ + efi/mkreloc diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index ba732e4a88c3..1ac8cb435e0e 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -21,3 +21,5 @@ $(obj)/cmdline.S: $(src)/cmdline.c $(CMDLINE_DEPS) $(src)= /build32.lds =20 $(obj)/reloc.S: $(src)/reloc.c $(RELOC_DEPS) $(src)/build32.lds $(MAKE) -f $(abs_srctree)/$(src)/build32.mk -C $(obj) $(@F) RELOC_DEPS=3D= "$(RELOC_DEPS)" + +clean-files :=3D cmdline.S reloc.S *.lnk *.bin diff --git a/xen/common/Makefile b/xen/common/Makefile index ca839118e4d1..dc8d3a13f5b8 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -84,5 +84,4 @@ $(obj)/config_data.S: $(BASEDIR)/tools/binfile FORCE $(call if_changed,binfile,$(obj)/config.gz xen_config_data) targets +=3D config_data.S =20 -clean:: - rm -f config_data.S config.gz 2>/dev/null +clean-files :=3D config.gz diff --git a/xen/include/Makefile b/xen/include/Makefile index cd40d5b4c923..a3c2511f5f60 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -131,6 +131,4 @@ lib-x86-all: all: lib-x86-all endif =20 -clean:: - rm -rf compat config generated headers*.chk - rm -f $(BASEDIR)/include/xen/lib/x86/cpuid-autogen.h +clean-files :=3D compat config generated headers*.chk xen/lib/x86/cpuid-au= togen.h diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include index 79b42e1252d6..d56bf7d4a452 100644 --- a/xen/scripts/Kbuild.include +++ b/xen/scripts/Kbuild.include @@ -99,8 +99,8 @@ build :=3D -f $(srctree)/Rules.mk obj =20 # Shorthand for $(MAKE) clean # Usage: -# $(MAKE) $(clean) dir -clean :=3D -f $(BASEDIR)/scripts/Makefile.clean clean -C +# $(Q)$(MAKE) $(clean)=3Ddir +clean :=3D -f $(srctree)/scripts/Makefile.clean obj =20 # echo command. # Short version is used, if $(quiet) equals `quiet_', otherwise full one. diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean index c2689d4af5fa..4eed31974509 100644 --- a/xen/scripts/Makefile.clean +++ b/xen/scripts/Makefile.clean @@ -3,7 +3,6 @@ # 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 =20 -obj :=3D . src :=3D $(obj) =20 clean:: @@ -17,11 +16,20 @@ include $(src)/Makefile subdir-all :=3D $(subdir-y) $(subdir-n) $(subdir-) \ $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-))) =20 +subdir-all :=3D $(addprefix $(obj)/,$(subdir-all)) + __clean-files :=3D \ $(clean-files) $(hostprogs-y) $(hostprogs-) \ + $(extra-y) $(extra-) $(targets) \ $(hostprogs-always-y) $(hostprogs-always-) =20 -__clean-files :=3D $(wildcard $(__clean-files)) +# clean-files is given relative to the current directory, unless it +# starts with $(objtree)/ (which means "./", so do not add "./" unless +# you want to delete a file from the toplevel object directory). + +__clean-files :=3D $(wildcard \ + $(addprefix $(obj)/, $(filter-out /% $(objtree)/%, $(__clean-files)))= \ + $(filter /% $(objtree)/%, $(__clean-files))) =20 .PHONY: clean clean:: $(subdir-all) @@ -35,6 +43,6 @@ endif =20 PHONY +=3D $(subdir-all) $(subdir-all): - $(MAKE) $(clean) $@ + $(Q)$(MAKE) $(clean)=3D$@ =20 .PHONY: $(PHONY) diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile index adb484dc5d2c..e6fee84b69da 100644 --- a/xen/test/livepatch/Makefile +++ b/xen/test/livepatch/Makefile @@ -160,6 +160,4 @@ install: $(addprefix $(obj)/,$(LIVEPATCHES)) uninstall: cd $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) && rm -f $(LIVEPATCHES) =20 -.PHONY: clean -clean:: - rm -f *.livepatch config.h expect_config.h +clean-files :=3D config.h expect_config.h diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile index 832f65274cc0..4ac6fb8778ae 100644 --- a/xen/xsm/flask/Makefile +++ b/xen/xsm/flask/Makefile @@ -49,6 +49,4 @@ $(obj)/policy.bin: FORCE FLASK_BUILD_DIR=3D$(FLASK_BUILD_DIR) POLICY_FILENAME=3D$(POLICY_S= RC) cmp -s $(POLICY_SRC) $@ || cp $(POLICY_SRC) $@ =20 -.PHONY: clean -clean:: - rm -f $(ALL_H_FILES) policy.* $(POLICY_SRC) flask-policy.S +clean-files :=3D policy.* $(POLICY_SRC) --=20 Anthony PERARD