[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN PATCH v8 21/47] build: generate x86's asm-macros.h with filechk
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Date: Thu, 25 Nov 2021 13:39:40 +0000
- Authentication-results: esa1.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: Thu, 25 Nov 2021 13:47:01 +0000
- Ironport-data: A9a23:fcA6BKLtsTbQAWS6FE+R6JIlxSXFcZb7ZxGr2PjKsXjdYENSgWAAz DNKXT/SOPjZZGv3f9hyOo3j901UvZDUyNBnSARlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUZUideSc+EH140Es5xrZj6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB2Lndt30 cd3r6buCi1wIPPVxO8AVENXRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsFlgNgjK8/6epsSoHh6wRnSDOo8QICFSKLPjTNd9Gph3pgQRayAD yYfQQU+XTTEbw19Bmo4A5hunsa2qHn9cwQN/Tp5ooJoujOOnWSdyoPFL979atGMA8JPkS6wp GjL4mD4CREyL8GExHyO9XfErv/Cm2b3VZwfEJW89+V2mxuDy2oLEhoUWFCn5/6jhSaDt8l3c hJOvHB09O5rqRLtHoKVswCETGCsvBwXXcNCKfcAtkK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4V1rdCRaDfIEJlzz8d/c0C8arvfBn/HNxit/kNlsINYx6LsUPqaP9TQ BgnaggibGTylRaa8+lZ7Tj0c6n5WTwdW4YS9RqcjIMeZHXSsOAYBY6YKyEJ7QClXSQRKv7Y2Ip 4bGyZ/RllGZZ48cnjfgvFCjDsbxRyiJezD453YtfaGuBAEHtOZ0IAySYpIZDa9USk0kCg9kuxr ya4qJ3Ug4R3FQgQ85mKuYDSBhFbcxyQPp0dxpgDYJpuPaOKOdxy4oizaF3LOeZDhDNAAle4/Aj Spg1svLVHGs38fgEfaip5jYc
- 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 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
|