xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: wei.liu2@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] stubdom: simplify and fix Makefile
Date: Fri, 4 Nov 2016 10:56:15 +0100	[thread overview]
Message-ID: <20161104095615.GA4908@var.bordeaux.inria.fr> (raw)
In-Reply-To: <1478253209-30743-1-git-send-email-jgross@suse.com>

Juergen Gross, on Fri 04 Nov 2016 10:53:29 +0100, wrote:
> The stubdom Makefile is setting up links for various libraries. This
> is done only once when qemu links are created and each library's links
> are updated/created only if the link for the Makefile of the library
> isn't already existing. In case a source is added to one library after
> doing the first make of stubdom the new source won't be linked by a
> new call of make.
> 
> Instead of testing the existence of the Makefile link use a make
> dependency which will catch changes of the linked Makefile, too.
> 
> At the same time don't repeat the same link pattern 7 times but use a
> make macro to do the linking.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/Makefile | 77 ++++++++++++++++++++++++++------------------------------
>  1 file changed, 35 insertions(+), 42 deletions(-)
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index 2921f30..9b30b58 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -305,7 +305,41 @@ ioemu/linkfarm.stamp:
>  	touch ioemu/linkfarm.stamp
>  endif
>  
> -mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
> +define do_links
> +  touch $@
> +  mkdir -p $(dir $@)include
> +  cd $(dir $@); \
> +  ln -sf $(dir $<)include/*.h include/; \
> +  ln -sf $(dir $<)*.[ch] .; \
> +  ln -sf $(dir $<)Makefile .
> +endef
> +
> +libs-$(XEN_TARGET_ARCH)/toollog/stamp: $(XEN_ROOT)/tools/libs/toollog/Makefile
> +	$(do_links)
> +
> +libs-$(XEN_TARGET_ARCH)/evtchn/stamp: $(XEN_ROOT)/tools/libs/evtchn/Makefile
> +	$(do_links)
> +
> +libs-$(XEN_TARGET_ARCH)/gnttab/stamp: $(XEN_ROOT)/tools/libs/gnttab/Makefile
> +	$(do_links)
> +
> +libs-$(XEN_TARGET_ARCH)/call/stamp: $(XEN_ROOT)/tools/libs/call/Makefile
> +	$(do_links)
> +
> +libs-$(XEN_TARGET_ARCH)/foreignmemory/stamp: $(XEN_ROOT)/tools/libs/foreignmemory/Makefile
> +	$(do_links)
> +
> +libxc-$(XEN_TARGET_ARCH)/stamp: $(XEN_ROOT)/tools/libxc/Makefile
> +	$(do_links)
> +
> +xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
> +	$(do_links)
> +
> +LINK_LIBS_DIRS := toollog evtchn gnttab call foreignmemory
> +LINK_DIRS := libxc-$(XEN_TARGET_ARCH) xenstore $(foreach dir,$(LINK_LIBS_DIRS),libs-$(XEN_TARGET_ARCH)/$(dir))
> +LINK_STAMPS := $(foreach dir,$(LINK_DIRS),$(dir)/stamp)
> +
> +mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET) $(LINK_STAMPS)
>  	$(MAKE) -C $(XEN_ROOT)/tools/include
>  	mkdir -p include/xen && \
>            ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) include/xen && \
> @@ -316,47 +350,6 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
>  	  ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) include/xen-foreign/ && \
>  	  $(MAKE) DESTDIR= -C include/xen-foreign/ && \
>  	  ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
> -	mkdir -p libs-$(XEN_TARGET_ARCH)/toollog/include
> -	[ -h libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/toollog && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/toollog/include/*.h include/ && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/toollog/*.c . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/toollog/Makefile . )
> -	mkdir -p libs-$(XEN_TARGET_ARCH)/evtchn/include
> -	[ -h libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/evtchn && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.h . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/include/*.h include/ && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.c . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/Makefile . )
> -	mkdir -p libs-$(XEN_TARGET_ARCH)/gnttab/include
> -	[ -h libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/gnttab && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.h . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/include/*.h include/ && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.c . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/Makefile . )
> -	mkdir -p libs-$(XEN_TARGET_ARCH)/call/include
> -	[ -h libs-$(XEN_TARGET_ARCH)/call/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/call && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/call/*.h . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/call/include/*.h include/ && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/call/*.c . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/call/Makefile . )
> -	mkdir -p libs-$(XEN_TARGET_ARCH)/foreignmemory/include
> -	[ -h libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/foreignmemory && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/*.h . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/include/*.h include/ && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/*.c . && \
> -	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/Makefile . )
> -	mkdir -p libxc-$(XEN_TARGET_ARCH)/include
> -	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
> -	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
> -	  ln -sf $(XEN_ROOT)/tools/libxc/include/*.h include/ && \
> -	  ln -sf $(XEN_ROOT)/tools/libxc/*.c . && \
> -	  ln -sf $(XEN_ROOT)/tools/libxc/Makefile . )
> -	mkdir -p xenstore/include
> -	[ -h xenstore/Makefile ] || ( cd xenstore && \
> -	  ln -sf $(XEN_ROOT)/tools/xenstore/*.c . && \
> -	  ln -sf $(XEN_ROOT)/tools/xenstore/*.h . && \
> -	  ln -sf $(XEN_ROOT)/tools/xenstore/include/*.h include/ && \
> -	  ln -sf $(XEN_ROOT)/tools/xenstore/Makefile . )
>  	$(MAKE) DESTDIR= -C $(MINI_OS) links
>  	touch mk-headers-$(XEN_TARGET_ARCH)
>  
> -- 
> 2.6.6
> 

-- 
Samuel
<v> je viens d'inventer mutt version magritte :D
<y> ?
<v> dans mutt
<v> tape "cceci" return

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-11-04  9:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04  9:53 [PATCH] stubdom: simplify and fix Makefile Juergen Gross
2016-11-04  9:56 ` Samuel Thibault [this message]
2016-11-04 14:20 ` Wei Liu
2016-11-04 14:29   ` Juergen Gross
2016-11-04 14:31     ` Wei Liu
2016-11-04 14:44       ` Juergen Gross
2016-11-04 14:59         ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161104095615.GA4908@var.bordeaux.inria.fr \
    --to=samuel.thibault@ens-lyon.org \
    --cc=jgross@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).