From: "Jan Beulich" Subject: [PATCH] include: parallelize compat/xlat.h generation Date: Fri, 28 Feb 2014 16:59:56 +0000 Message-ID: <5310CE9C02000078001204D7@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part7745399C.0__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WJQmm-000642-Gl for xen-devel@lists.xenproject.org; Fri, 28 Feb 2014 16:59:44 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part7745399C.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Splitting this up into pieces signficantly speeds up building on multi- CPU systems when making use of make's -j option. Signed-off-by: Jan Beulich --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -66,14 +66,24 @@ compat/%.c: public/%.h xlat.lst Makefile $(PYTHON) $(BASEDIR)/tools/compat-build-source.py >$@.new mv -f $@.new $@ =20 -compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) = $(BASEDIR)/tools/get-fields.sh Makefile +compat/.xlat/%.h: compat/%.h compat/.xlat/%.lst $(BASEDIR)/tools/get-field= s.sh Makefile export PYTHON=3D$(PYTHON); \ - grep -v '^[ ]*#' xlat.lst | \ - while read what name hdr; do \ - hdr=3D"compat/$$(echo $$hdr | sed 's,@arch@,$(compat-arch-y= ),g')"; \ - echo '$(headers-y)' | grep -q "$$hdr" || continue; \ - $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$n= ame $$hdr || exit $$?; \ - done >$@.new + while read what name; do \ + $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$n= ame $< || exit $$?; \ + done <$(patsubst compat/%,compat/.xlat/%,$(basename $<)).lst = >$@.new + mv -f $@.new $@ + +.PRECIOUS: compat/.xlat/%.lst +compat/.xlat/%.lst: xlat.lst Makefile + mkdir -p $(@D) + grep -v '^[ \t]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -e = 's,[ \t]\+$*\.h[ \t]*$$,,p' >$@.new + $(call move-if-changed,$@.new,$@) + +xlat-y :=3D $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,^[?!][ = \t]\+[^ \t]\+[ \t]\+,,p' xlat.lst | uniq) +xlat-y :=3D $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y)) + +compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile + cat $(filter %.h,$^) >$@.new mv -f $@.new $@ =20 ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH)) --=__Part7745399C.0__= Content-Type: text/plain; name="parallel-include-compat-build.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="parallel-include-compat-build.patch" include: parallelize compat/xlat.h generation=0A=0ASplitting this up into = pieces signficantly speeds up building on multi-=0ACPU systems when making = use of make's -j option.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/include/Makefile=0A+++ b/xen/include/Makefile=0A@@ -66,14 = +66,24 @@ compat/%.c: public/%.h xlat.lst Makefile=0A $(PYTHON) = $(BASEDIR)/tools/compat-build-source.py >$@.new=0A mv -f $@.new $@=0A = =0A-compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) = $(BASEDIR)/tools/get-fields.sh Makefile=0A+compat/.xlat/%.h: compat/%.h = compat/.xlat/%.lst $(BASEDIR)/tools/get-fields.sh Makefile=0A export = PYTHON=3D$(PYTHON); \=0A- grep -v '^[ ]*#' xlat.lst | \=0A- = while read what name hdr; do \=0A- hdr=3D"compat/$$(echo = $$hdr | sed 's,@arch@,$(compat-arch-y),g')"; \=0A- echo = '$(headers-y)' | grep -q "$$hdr" || continue; \=0A- $(SHELL) = $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$hdr || exit $$?; = \=0A- done >$@.new=0A+ while read what name; do \=0A+ = $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $< || exit = $$?; \=0A+ done <$(patsubst compat/%,compat/.xlat/%,$(basename = $<)).lst >$@.new=0A+ mv -f $@.new $@=0A+=0A+.PRECIOUS: compat/.xlat/%.ls= t=0A+compat/.xlat/%.lst: xlat.lst Makefile=0A+ mkdir -p $(@D)=0A+ = grep -v '^[ \t]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,[ = \t]\+$*\.h[ \t]*$$,,p' >$@.new=0A+ $(call move-if-changed,$@.new,$@)= =0A+=0A+xlat-y :=3D $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e = 's,^[?!][ \t]\+[^ \t]\+[ \t]\+,,p' xlat.lst | uniq)=0A+xlat-y :=3D = $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))=0A+=0A+compat/xlat.= h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile=0A+ cat $(filter = %.h,$^) >$@.new=0A mv -f $@.new $@=0A =0A ifeq ($(XEN_TARGET_ARCH),$(X= EN_COMPILE_ARCH))=0A --=__Part7745399C.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part7745399C.0__=--