]> xenbits.xensource.com Git - xen.git/commitdiff
build: use $(filechk, ) for all compat/.xlat/%.lst
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 26 May 2023 07:17:46 +0000 (09:17 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 26 May 2023 07:17:46 +0000 (09:17 +0200)
Making use of filechk means that we don't have to use
$(move-if-changed,). It also means that will have sometimes "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>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Tested-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/Makefile

index 96d5f6f3c887f0c167f825bab7911ed98d5cf2a5..2e61b50139d7931ce760c6c2f20723a71c46733e 100644 (file)
@@ -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))