[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH v9 18/30] build: generate x86's asm-macros.h with filechk


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 25 Jan 2022 11:00:51 +0000
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 25 Jan 2022 11:07:31 +0000
  • Ironport-data: A9a23:XG8o/q4yz+kns/m5TAqCvwxRtOzAchMFZxGqfqrLsTDasY5as4F+v mocX2jVOquNZ2Ogetx/Ody28kkB6MWAn95iTQA9rCk2Hi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuV3zyIQUBUjclkfJKlYAL/En03FV8MpBsJ00o5wbZg2NMw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Zz +kRkIGUV1cVGKjGpu45AwdbEjFfIvgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALJc/3PIQZqzd4wCvQF/oOSpHfWaTao9Rf2V/cg+gQR6iPN ppINFKDajzkUQBFBHMOKKtmws2LniP5VSV9s3G88P9fD2/7k1UqjemF3MDuUsOObdVYmACfv G2u12bzDwweNdef4SGY6X/qjejK9QvrVYRXGLCm+/pChFyI2ndVGBAQTUG8o/Sylgi5Qd03F qAP0nNw9+5orhXtF4SjGU3jyJKZgvICc91sT8gnz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bAsxD4bXLfCFHZK3BgTVQfexO/DD+ytHLudvj
  • Ironport-sdr: 7fGqrx5EqigVo8VPPv8hW0O3oga3EzqSXc7oSh0+frN88561YQBOGlbVvj+yNhwxDcEsmHTHLR x8FzdloCYOOpZRKMfJ0BFqJPaVAqMhh7dhpB/TbYGkaM2FsyztmPCsnHdFYOjmtVZVL5H6HB1k Iw9zthguv2nUwPI7UU+mGC7bV7TJE8iXPU1GrzS4jfHCAJRRUPR9Y4Buf3EBKxwkF1Fsho1uNC 6+L8jwo2eTwMx3WyYHQ3iz9uk6PMVk/cdVufv/iXE/AW/1wvvXnFlNCVEtt551PEG7T5Rc5dPW ZlHLArGNkMc0ctMOiTKOKBs2
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <anthony.perard@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 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
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.