From patchwork Tue Jan 25 11:00:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 12723654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0E9BC43217 for ; Tue, 25 Jan 2022 11:07:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.260096.449246 (Exim 4.92) (envelope-from ) id 1nCJfe-0006Hp-W6; Tue, 25 Jan 2022 11:07:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 260096.449246; Tue, 25 Jan 2022 11:07:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nCJfe-0006Di-HU; Tue, 25 Jan 2022 11:07:30 +0000 Received: by outflank-mailman (input) for mailman id 260096; Tue, 25 Jan 2022 11:07:28 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nCJaF-0006t5-Bu for xen-devel@lists.xenproject.org; Tue, 25 Jan 2022 11:01:55 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3438a97b-7dce-11ec-bc18-3156f6d857e4; Tue, 25 Jan 2022 12:01:53 +0100 (CET) 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: 3438a97b-7dce-11ec-bc18-3156f6d857e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1643108513; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MlVc33IS7S+4kuvMZHec69OzaPEt83rbtePEqH7p84k=; b=fFXhLPNIzvWGdpgtnL+ujm5cmAM02ss0XMgGzoaYNfCOdIso0w7CfAWH iXu6TLUr6V6wkAG31NlJZ00fokpEjfrDnI1ZeYFCiHTDV9Lbe5uVPviEg +V+tq5cMCavAJXDpfF2plcazd0Dvi1Zm8Eqav1FqZGWtBXvTgzrAcoNpQ s=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 7fGqrx5EqigVo8VPPv8hW0O3oga3EzqSXc7oSh0+frN88561YQBOGlbVvj+yNhwxDcEsmHTHLR x8FzdloCYOOpZRKMfJ0BFqJPaVAqMhh7dhpB/TbYGkaM2FsyztmPCsnHdFYOjmtVZVL5H6HB1k Iw9zthguv2nUwPI7UU+mGC7bV7TJE8iXPU1GrzS4jfHCAJRRUPR9Y4Buf3EBKxwkF1Fsho1uNC 6+L8jwo2eTwMx3WyYHQ3iz9uk6PMVk/cdVufv/iXE/AW/1wvvXnFlNCVEtt551PEG7T5Rc5dPW ZlHLArGNkMc0ctMOiTKOKBs2 X-SBRS: 5.2 X-MesageID: 62699895 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:XG8o/q4yz+kns/m5TAqCvwxRtOzAchMFZxGqfqrLsTDasY5as4F+v mocX2jVOquNZ2Ogetx/Ody28kkB6MWAn95iTQA9rCk2Hi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuV3zyIQUBUjclkfJKlYAL/En03FV8MpBsJ00o5wbZg2NMw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8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lCcLaNKCmw1+r5CBPk+NuRUrYZNJUfRy0ooRtLiXwiN4xIt0NdkqflmfLi V7ODE5B9+fXooIz/N3Yvoy+rt+kQ7lkA05XP2jH9rLqZyPUyXWunN1bW+GScDGDCG6toPe+Z f9Yxu3XOeEcmAoYqJJ1FrtmwP5s59broLMGnA1oEG+SMgauA7JkZHKHwdNOputGwboA4Vm6X UeG+997P7SVOZy6TA5NdVR9NunTh+sJnjTy7OguJBSo7SB6y7OLTEFOMkTekydaNrZ0bNsoz OpJVBT6MOBjZs7G6uq7sx0= IronPort-HdrOrdr: A9a23:0dA1jqmZ+JUcYZTIlQZZYGMAQ3npDfIU3DAbv31ZSRFFG/Fxl6 iV8sjzsiWE7gr5OUtQ4exoV5PhfZqxz/JICMwqTNKftWrdyQyVxeNZnOjfKlTbckWUnINgPO VbAsxD4bXLfCFHZK3BgTVQfexO/DD+ytHLudvj X-IronPort-AV: E=Sophos;i="5.88,314,1635220800"; d="scan'208";a="62699895" From: Anthony PERARD To: CC: Anthony PERARD , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [XEN PATCH v9 18/30] build: generate x86's asm-macros.h with filechk Date: Tue, 25 Jan 2022 11:00:51 +0000 Message-ID: <20220125110103.3527686-19-anthony.perard@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220125110103.3527686-1-anthony.perard@citrix.com> References: <20220125110103.3527686-1-anthony.perard@citrix.com> MIME-Version: 1.0 When we will build out-of-tree, make is going to try to generate "asm-macros.h" before the directories "arch/x86/include/asm" exist, thus we would need to call `mkdir` explicitly. We will use "filechk" for that as it does everything that the current recipe does and does call `mkdir`. Also, they are no more "*.new" files generated in this directory. Signed-off-by: Anthony PERARD Acked-by: Jan Beulich --- xen/arch/x86/Makefile | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 9494e4a3df79..de7f7ce07b98 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -230,18 +230,21 @@ include: $(BASEDIR)/arch/x86/include/asm/asm-macros.h $(obj)/asm-macros.i: CFLAGS-y += -D__ASSEMBLY__ -P $(BASEDIR)/arch/x86/include/asm/asm-macros.h: $(obj)/asm-macros.i $(src)/Makefile - echo '#if 0' >$@.new - echo '.if 0' >>$@.new - echo '#endif' >>$@.new - echo '#ifndef __ASM_MACROS_H__' >>$@.new - echo '#define __ASM_MACROS_H__' >>$@.new - echo 'asm ( ".include \"$@\"" );' >>$@.new - echo '#endif /* __ASM_MACROS_H__ */' >>$@.new - echo '#if 0' >>$@.new - echo '.endif' >>$@.new - cat $< >>$@.new - echo '#endif' >>$@.new - $(call move-if-changed,$@.new,$@) + $(call filechk,asm-macros.h) + +define filechk_asm-macros.h + echo '#if 0'; \ + echo '.if 0'; \ + echo '#endif'; \ + echo '#ifndef __ASM_MACROS_H__'; \ + echo '#define __ASM_MACROS_H__'; \ + echo 'asm ( ".include \"$@\"" );'; \ + echo '#endif /* __ASM_MACROS_H__ */'; \ + echo '#if 0'; \ + echo '.endif'; \ + cat $<; \ + echo '#endif' +endef $(obj)/efi.lds: AFLAGS-y += -DEFI $(obj)/xen.lds $(obj)/efi.lds: $(src)/xen.lds.S FORCE @@ -255,7 +258,7 @@ $(obj)/efi/mkreloc: $(src)/efi/mkreloc.c .PHONY: clean clean:: - rm -f *.lds *.new boot/*.o boot/*~ boot/core boot/mkelf32 + rm -f *.lds boot/*.o boot/*~ boot/core boot/mkelf32 rm -f asm-macros.i $(BASEDIR)/arch/x86/include/asm/asm-macros.* rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d $(BASEDIR)/.xen.elf32 rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/mkreloc