From mboxrd@z Thu Jan 1 00:00:00 1970 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 E7A63C433EF for ; Thu, 25 Nov 2021 13:47:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.231234.400068 (Exim 4.92) (envelope-from ) id 1mqF5R-00063K-S3; Thu, 25 Nov 2021 13:46:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 231234.400068; Thu, 25 Nov 2021 13:46: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 1mqF5R-00063D-Oj; Thu, 25 Nov 2021 13:46:53 +0000 Received: by outflank-mailman (input) for mailman id 231234; Thu, 25 Nov 2021 13:46:53 +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 1mqF03-00076i-MS for xen-devel@lists.xenproject.org; Thu, 25 Nov 2021 13:41:19 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5d8200b7-4df5-11ec-a9d2-d9f7a1cc8784; Thu, 25 Nov 2021 14:41:18 +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: 5d8200b7-4df5-11ec-a9d2-d9f7a1cc8784 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1637847678; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5TWrEHNuNLFROz3IyERYFp+CoH2z9NcBZf52JXIU9Zw=; b=OxaSsMKuzrPIsRZNm1xSDw7YyruEdOv241n+BjGMXSVYxAA7gR1bBwd1 1MSCXjp/RrQ+vDJlBJRDEK8UFQ7/j1HXecWTqXVnUbcEcO+FvuBf95y1s b45bE7AkNoUP5GhIft9nj2Ncxs+bRuetAOah0EaGF5wcUPBZq3hLFLbwv s=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: RVJ7aAuQBHjZzqUlN7p4V1rdCRaDfIEJlzz8d/c0C8arvfBn/HNxit/kNlsINYx6LsUPqaP9TQ BgnaggibGTylRaa8+lZ7Tj0c6n5WTwdW4YS9RqcjIMeZHXSsOAYBY6YKyEJ7QClXSQRKv7Y2Ip 4bGyZ/RllGZZ48cnjfgvFCjDsbxRyiJezD453YtfaGuBAEHtOZ0IAySYpIZDa9USk0kCg9kuxr ya4qJ3Ug4R3FQgQ85mKuYDSBhFbcxyQPp0dxpgDYJpuPaOKOdxy4oizaF3LOeZDhDNAAle4/Aj Spg1svLVHGs38fgEfaip5jYc X-SBRS: 5.1 X-MesageID: 59006026 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:fcA6BKLtsTbQAWS6FE+R6JIlxSXFcZb7ZxGr2PjKsXjdYENSgWAAz DNKXT/SOPjZZGv3f9hyOo3j901UvZDUyNBnSARlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUZUideSc+EH140Es5xrZj6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGt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ErUiExMCTXXb97u/KQLT4nGnnd1bSO+NcD3QCDH09aGla bkHxv3wKqRazlNDso46GLd316MuodDoouYCnAhjGXzKaXWtC69hfSbajZUe6PUVy+8LoxayV 2KO5sJeaOeAN87SGVIMIBYoM7aY3vYOlziOtfk4LS0WPsOsEGZrhamKAySxtQ== IronPort-HdrOrdr: A9a23:/DRNAK04LvYOHONEZngSwAqjBLQkLtp133Aq2lEZdPRUGvb2qy nIpoV96faUskdpZJhOo7G90cW7LE80sKQFg7X5Xo3SODUO2lHJEGgK1+KLqFfd8m/Fh4tgPM 9bAs5D4bbLY2SS4/yX3ODBKadC/OW6 X-IronPort-AV: E=Sophos;i="5.87,263,1631592000"; d="scan'208";a="59006026" From: Anthony PERARD To: CC: Anthony PERARD , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [XEN PATCH v8 21/47] build: generate x86's asm-macros.h with filechk Date: Thu, 25 Nov 2021 13:39:40 +0000 Message-ID: <20211125134006.1076646-22-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: 8bit Content-Type: text/plain 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 456b7eed7536..873b32cc6945 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 -- Anthony PERARD