diff mbox series

[XEN,08/15] build: use $(filechk, ) for all compat/.xlat/%.lst

Message ID 20230523163811.30792-9-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series build: cleanup build log, avoid user's CFLAGS, avoid too many include of Config.mk | expand

Commit Message

Anthony PERARD May 23, 2023, 4:38 p.m. UTC
Make use of filechk mean that we don't have to use
$(move-if-changed,). It also mean that will have sometime "UPD .." in
the build output when the target changed, rather than having "GEN ..."
all the time when "xlat.lst" happen to have a more recent modification
timestamp.

While there, replace `grep -v` by `sed '//d'` to avoid an extra
fork and pipe when building.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/include/Makefile | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Luca Fancellu May 24, 2023, 8:13 a.m. UTC | #1
> On 23 May 2023, at 17:38, Anthony PERARD <anthony.perard@citrix.com> wrote:
> 
> Make use of filechk mean that we don't have to use
> $(move-if-changed,). It also mean that will have sometime "UPD .." in
> the build output when the target changed, rather than having "GEN ..."
> all the time when "xlat.lst" happen to have a more recent modification
> timestamp.
> 
> While there, replace `grep -v` by `sed '//d'` to avoid an extra
> fork and pipe when building.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---


Seems good to me!

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Tested-by: Luca Fancellu <luca.fancellu@arm.com>
Jan Beulich May 25, 2023, 12:04 p.m. UTC | #2
On 23.05.2023 18:38, Anthony PERARD wrote:
> Make use of filechk mean that we don't have to use

I think you mean "Making use of filechk means ...", or else it reads as
if you're changing how filechk behaves. (I'd again be happy to adjust
while committing, provided you agree; here it looks pretty clear that
there is no dependency on earlier patches, and there's also no need to
wait for further acks.)

> $(move-if-changed,). It also mean that will have sometime "UPD .." in
> the build output when the target changed, rather than having "GEN ..."
> all the time when "xlat.lst" happen to have a more recent modification
> timestamp.
> 
> While there, replace `grep -v` by `sed '//d'` to avoid an extra
> fork and pipe when building.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
Anthony PERARD May 25, 2023, 2:36 p.m. UTC | #3
On Thu, May 25, 2023 at 02:04:00PM +0200, Jan Beulich wrote:
> On 23.05.2023 18:38, Anthony PERARD wrote:
> > Make use of filechk mean that we don't have to use
> 
> I think you mean "Making use of filechk means ...", or else it reads as
> if you're changing how filechk behaves. (I'd again be happy to adjust
> while committing, provided you agree; here it looks pretty clear that
> there is no dependency on earlier patches, and there's also no need to
> wait for further acks.)

The change sounds good. And yes, no dependency.

> > $(move-if-changed,). It also mean that will have sometime "UPD .." in
> > the build output when the target changed, rather than having "GEN ..."
> > all the time when "xlat.lst" happen to have a more recent modification
> > timestamp.
> > 
> > While there, replace `grep -v` by `sed '//d'` to avoid an extra
> > fork and pipe when building.
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks,
diff mbox series

Patch

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 96d5f6f3c8..2e61b50139 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -93,15 +93,13 @@  targets += $(patsubst compat/%, compat/.xlat/%, $(headers-y))
 $(obj)/compat/.xlat/%.h: $(obj)/compat/%.h $(obj)/compat/.xlat/%.lst $(srctree)/tools/compat-xlat-header.py FORCE
 	$(call if_changed,xlat_headers)
 
-quiet_cmd_xlat_lst = GEN     $@
-cmd_xlat_lst = \
-	grep -v '^[[:blank:]]*$(pound)' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -re 's,[[:blank:]]+$*\.h[[:blank:]]*$$,,p' >$@.new; \
-	$(call move-if-changed,$@.new,$@)
+filechk_xlat_lst = \
+	sed -ne '/^[[:blank:]]*$(pound)/d' -e 's,@arch@,$(compat-arch-y),g' -re 's,[[:blank:]]+$*\.h[[:blank:]]*$$,,p' $<
 
 .PRECIOUS: $(obj)/compat/.xlat/%.lst
 targets += $(patsubst compat/%.h, compat/.xlat/%.lst, $(headers-y))
 $(obj)/compat/.xlat/%.lst: $(srcdir)/xlat.lst FORCE
-	$(call if_changed,xlat_lst)
+	$(call filechk,xlat_lst)
 
 xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -re 's,^[?!][[:blank:]]+[^[:blank:]]+[[:blank:]]+,,p' $(srcdir)/xlat.lst | uniq)
 xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))