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

[XEN PATCH v7 36/51] build: generate x86's asm-macros.h with filechk


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 24 Aug 2021 11:50:23 +0100
  • 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, 24 Aug 2021 11:01:25 +0000
  • Ironport-hdrordr: A9a23:fMZf2arIimsxEIPcRlDuP6YaV5uXL9V00zEX/kB9WHVpm5Oj+v xGzc5w6farsl0ssSkb6La90KnpexPhHO1OkPAs1NaZLULbUQSTXeVfBOfZrQEIeBeOvNK1t5 0QFJSWYeeYZTQUsS+Q2njaLz9U+qjjzEnev5a9854Cd2BXQpAlyz08JheQE0VwSgUDL4E+Do Cg6s1OoCflUWgLb+ygb0N1E9TrlpnurtbLcBQGDxko5E2lljWz8oP3FBCew1M3Ty5P+7E/6m LI+jaJqZlL8svLhCM05VWjr6i+q+GRieerw/b8yPT9Hw+cyzpAor4RHoFq8gpF5N1Ho2xa6O Uk6y1QRPibrUmhM11d6CGdoTXIwXIg7WTvxkSfhmamqcvlRCgiA84Eno5BdADFgnBQyu2U/Z g7q15xjaAnei8oXR6NluTgRlVvjA65sHAimekcgzhWVpYfcqZYqcga8FlOGJkNESrm4MR/ed MeRP309bJTaxeXfnrZtm5gzJilWWkyBA6PRgwHttaO2zZbkXhlxw8TxdAZnH0H6JUhIqM0rt jsI+BtjvVDX8UWZaVyCKMIRta2EHXERVbWPGebMT3cZdQ60rL22uzKCZAOlZ+XkbAzvecPca X6ISBlXDQJCj/T4OW1reJ22wGIW2OgQDio0d1a6/FCy83BeIY=
  • Ironport-sdr: 8Pi9jibUCalk3QDJxoRQbBzIKB1rsgoQSyCyx3jEvp1739Chw+CAKXsS3nPyLTQKi4lJ2LJmlp ZED/8KyRElYy3zq537iHhcTJO9oIdkk5E3yUbVKXYbibAtjI2JwIHKdGYeUOAiV1Ho84xcR8fj g0xo7Ob5FBREY+1Rq8gHnw0R3XmftwqbcT5Z0pLSAQUhVjPEPBPLsv3NXxY5POZq2qprAa7xtS 73YaBvjVIRq4yCB36xskESOZpDX4e+I7x47rwpbyQrcpBxiQncYV+l5F2p4zNNIcYJsYhqPjkH SOBNCWP+kpCWGGGu23ZJtHOc
  • 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>
---
 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 05f1d12065a0..1ef2536ece26 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -233,18 +233,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
@@ -258,7 +261,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®.