xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>, Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
Date: Mon, 19 Jun 2017 10:55:09 -0400	[thread overview]
Message-ID: <20170619145509.GR5848@char.us.oracle.com> (raw)
In-Reply-To: <1497882206-31657-1-git-send-email-ian.jackson@eu.citrix.com>

On Mon, Jun 19, 2017 at 03:23:26PM +0100, Ian Jackson wrote:
> In "xen/test/livepatch: Regularise Makefiles" we reworked
> xen/test/Makefile to use a pattern rule.  However, there are two
> problems with this.  Both are related to the way that xen/Rules.mk is
> implicitly part of this Makefile because of the way that Makefiles
> under xen/ are invoked by their parent directory Makefiles.
> 
> Firstly, the Rules.mk `clean' target overrides the pattern rule in
> xen/test/Makefile.  The result is that `make -C xen clean' does not
> actually run the livepatch clean target.
> 
> The Rules.mk clean target does have provision for recursing into
> subdirectories, but that feature is tangled up with complex object
> file iteration machinery which is not desirable here.  However, we can
> extend the Rules.mk clean target since it is a double-colon rules.
> 
> Sadly this involves duplicating the SUBDIR iteration boilerplate.  (A
> make function could be used but the cure would be worse than the
> disease.)
> 
> Secondly, Rules.mk has a number of -include directives.  make likes to
> try to (re)build files mentioned in includes.  With the % pattern
> rule, this applies to those files too.
> 
> As a result, make -C xen clean would try to build `.*.d' (for example)
> in xen/test.  This would fail with an error message.  The error would
> be ignored because of the `-', but it's annoying and ugly.

Aaah.
> 
> Solve this by limiting the % pattern rule to the targets we expect it
> to handle.  These are those listed in the top-level Makefile, apart
> from: those which are subdir- or component-qualified; clean targets
> (which are handled specially, even distclean); and dist,
> src-tarball-*, etc. (which are converted to install by an earlier
> Makefile).
> 
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>


> ---
>  xen/test/Makefile | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/test/Makefile b/xen/test/Makefile
> index aa1a23b..aaa4996 100644
> --- a/xen/test/Makefile
> +++ b/xen/test/Makefile
> @@ -7,7 +7,12 @@ ifneq ($(XEN_TARGET_ARCH),x86_32)
>  SUBDIRS += livepatch
>  endif
>  
> -%:
> +install build subtree-force-update uninstall: %:
>  	set -e; for s in $(SUBDIRS); do \
>  		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \
>  	done
> +
> +clean::
> +	set -e; for s in $(SUBDIRS); do \
> +		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $@; \
> +	done
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

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

  reply	other threads:[~2017-06-19 14:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
2017-06-07 14:51 ` [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch Ian Jackson
2017-06-07 15:04   ` Konrad Rzeszutek Wilk
2017-06-07 14:51 ` [PATCH 2/4] xen/test/livepatch: Regularise Makefiles Ian Jackson
2017-06-07 15:05   ` Konrad Rzeszutek Wilk
2017-06-07 14:51 ` [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore Ian Jackson
2017-06-07 15:06   ` Konrad Rzeszutek Wilk
2017-06-07 15:20   ` Jan Beulich
2017-06-07 14:51 ` [PATCH 4/4] Makefile: Provide way to ship livepatch test files Ian Jackson
2017-06-07 15:07   ` Konrad Rzeszutek Wilk
2017-06-07 15:58   ` Andrew Cooper
2017-06-07 15:07 ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Konrad Rzeszutek Wilk
2017-06-07 15:22 ` Jan Beulich
2017-06-07 15:31 ` Wei Liu
2017-06-07 15:53   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests [and 1 more messages] Ian Jackson
2017-06-09 12:41   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Julien Grall
2017-06-09 14:31     ` Ian Jackson
2017-06-14 10:28       ` Julien Grall
2017-06-19 12:59         ` Ian Jackson
2017-06-19 13:03           ` Andrew Cooper
2017-06-19 14:23             ` [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule Ian Jackson
2017-06-19 14:55               ` Konrad Rzeszutek Wilk [this message]
2017-06-19 20:14               ` Konrad Rzeszutek Wilk
2017-06-20 10:37                 ` Julien Grall

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=20170619145509.GR5848@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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).