diff mbox series

tools/Rules.mk: fix distclean

Message ID 20200109111505.12328-1-pdurrant@amazon.com (mailing list archive)
State New, archived
Headers show
Series tools/Rules.mk: fix distclean | expand

Commit Message

Paul Durrant Jan. 9, 2020, 11:15 a.m. UTC
Running 'make distclean' under tools will currently result in:

tools/Rules.mk:245: *** You have to run ./configure before building or installing the tools.  Stop.

This patch adds 'distclean', 'subdir-distclean%' and 'subdir-clean%' to
no-configure-targets, which allows 'make distclean' to run to completion.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wl@xen.org>
---
 tools/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wei Liu Jan. 9, 2020, 1:52 p.m. UTC | #1
On Thu, Jan 09, 2020 at 11:15:05AM +0000, Paul Durrant wrote:
> Running 'make distclean' under tools will currently result in:
> 
> tools/Rules.mk:245: *** You have to run ./configure before building or installing the tools.  Stop.
> 
> This patch adds 'distclean', 'subdir-distclean%' and 'subdir-clean%' to
> no-configure-targets, which allows 'make distclean' to run to completion.
> 
> Signed-off-by: Paul Durrant <pdurrant@amazon.com>

Fixes: 00691c6c90b

Sorry for not noticing the breakage while reviewing that patch.

Is there a way to pattern match all targets containing "clean"?

(Would have looked into it myself but -ETIME today)

> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wl@xen.org>
> ---
>  tools/Rules.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/Rules.mk b/tools/Rules.mk
> index 31cf419ef4..52f47be3f8 100644
> --- a/tools/Rules.mk
> +++ b/tools/Rules.mk
> @@ -239,7 +239,7 @@ subdir-all-% subdir-clean-% subdir-install-% subdir-uninstall-%: .phony
>  subdir-distclean-%: .phony
>  	$(MAKE) -C $* distclean
>  
> -no-configure-targets := clean subtree-force-update-all %-dir-force-update
> +no-configure-targets := distclean subdir-distclean% clean subdir-clean% subtree-force-update-all %-dir-force-update
>  ifeq (,$(filter $(no-configure-targets),$(MAKECMDGOALS)))
>  $(XEN_ROOT)/config/Tools.mk:
>  	$(error You have to run ./configure before building or installing the tools)
> -- 
> 2.20.1
>
Durrant, Paul Jan. 9, 2020, 2:02 p.m. UTC | #2
> -----Original Message-----
> From: Wei Liu <wl@xen.org>
> Sent: 09 January 2020 13:52
> To: Durrant, Paul <pdurrant@amazon.co.uk>
> Cc: xen-devel@lists.xenproject.org; Ian Jackson
> <ian.jackson@eu.citrix.com>; Wei Liu <wl@xen.org>; Anthony PERARD
> <anthony.perard@citrix.com>
> Subject: Re: [PATCH] tools/Rules.mk: fix distclean
> 
> On Thu, Jan 09, 2020 at 11:15:05AM +0000, Paul Durrant wrote:
> > Running 'make distclean' under tools will currently result in:
> >
> > tools/Rules.mk:245: *** You have to run ./configure before building or
> installing the tools.  Stop.
> >
> > This patch adds 'distclean', 'subdir-distclean%' and 'subdir-clean%' to
> > no-configure-targets, which allows 'make distclean' to run to
> completion.
> >
> > Signed-off-by: Paul Durrant <pdurrant@amazon.com>
> 
> Fixes: 00691c6c90b
> 
> Sorry for not noticing the breakage while reviewing that patch.
> 

Ok. I'm sure that could be added at commit if there are no other changes needed.

> Is there a way to pattern match all targets containing "clean"?
> 
> (Would have looked into it myself but -ETIME today)

I couldn't persuade filter to match against patterns with multiple % so this was the best I could come up with.

  Paul

> 
> > ---
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Wei Liu <wl@xen.org>
> > ---
> >  tools/Rules.mk | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/Rules.mk b/tools/Rules.mk
> > index 31cf419ef4..52f47be3f8 100644
> > --- a/tools/Rules.mk
> > +++ b/tools/Rules.mk
> > @@ -239,7 +239,7 @@ subdir-all-% subdir-clean-% subdir-install-% subdir-
> uninstall-%: .phony
> >  subdir-distclean-%: .phony
> >  	$(MAKE) -C $* distclean
> >
> > -no-configure-targets := clean subtree-force-update-all %-dir-force-
> update
> > +no-configure-targets := distclean subdir-distclean% clean subdir-clean%
> subtree-force-update-all %-dir-force-update
> >  ifeq (,$(filter $(no-configure-targets),$(MAKECMDGOALS)))
> >  $(XEN_ROOT)/config/Tools.mk:
> >  	$(error You have to run ./configure before building or installing
> the tools)
> > --
> > 2.20.1
> >
Wei Liu Jan. 9, 2020, 4:41 p.m. UTC | #3
On Thu, Jan 09, 2020 at 02:02:55PM +0000, Durrant, Paul wrote:
> > -----Original Message-----
> > From: Wei Liu <wl@xen.org>
> > Sent: 09 January 2020 13:52
> > To: Durrant, Paul <pdurrant@amazon.co.uk>
> > Cc: xen-devel@lists.xenproject.org; Ian Jackson
> > <ian.jackson@eu.citrix.com>; Wei Liu <wl@xen.org>; Anthony PERARD
> > <anthony.perard@citrix.com>
> > Subject: Re: [PATCH] tools/Rules.mk: fix distclean
> > 
> > On Thu, Jan 09, 2020 at 11:15:05AM +0000, Paul Durrant wrote:
> > > Running 'make distclean' under tools will currently result in:
> > >
> > > tools/Rules.mk:245: *** You have to run ./configure before building or
> > installing the tools.  Stop.
> > >
> > > This patch adds 'distclean', 'subdir-distclean%' and 'subdir-clean%' to
> > > no-configure-targets, which allows 'make distclean' to run to
> > completion.
> > >
> > > Signed-off-by: Paul Durrant <pdurrant@amazon.com>
> > 
> > Fixes: 00691c6c90b
> > 
> > Sorry for not noticing the breakage while reviewing that patch.
> > 
> 
> Ok. I'm sure that could be added at commit if there are no other changes needed.

Yes. Sure.

> 
> > Is there a way to pattern match all targets containing "clean"?
> > 
> > (Would have looked into it myself but -ETIME today)
> 
> I couldn't persuade filter to match against patterns with multiple %
> so this was the best I could come up with.
> 

OK.

Wei.
Wei Liu Jan. 10, 2020, 10:38 a.m. UTC | #4
On Thu, Jan 09, 2020 at 04:41:06PM +0000, Wei Liu wrote:
> On Thu, Jan 09, 2020 at 02:02:55PM +0000, Durrant, Paul wrote:
> > > -----Original Message-----
> > > From: Wei Liu <wl@xen.org>
> > > Sent: 09 January 2020 13:52
> > > To: Durrant, Paul <pdurrant@amazon.co.uk>
> > > Cc: xen-devel@lists.xenproject.org; Ian Jackson
> > > <ian.jackson@eu.citrix.com>; Wei Liu <wl@xen.org>; Anthony PERARD
> > > <anthony.perard@citrix.com>
> > > Subject: Re: [PATCH] tools/Rules.mk: fix distclean
> > > 
> > > On Thu, Jan 09, 2020 at 11:15:05AM +0000, Paul Durrant wrote:
> > > > Running 'make distclean' under tools will currently result in:
> > > >
> > > > tools/Rules.mk:245: *** You have to run ./configure before building or
> > > installing the tools.  Stop.
> > > >
> > > > This patch adds 'distclean', 'subdir-distclean%' and 'subdir-clean%' to
> > > > no-configure-targets, which allows 'make distclean' to run to
> > > completion.
> > > >
> > > > Signed-off-by: Paul Durrant <pdurrant@amazon.com>
> > > 
> > > Fixes: 00691c6c90b
> > > 
> > > Sorry for not noticing the breakage while reviewing that patch.
> > > 
> > 
> > Ok. I'm sure that could be added at commit if there are no other changes needed.
> 
> Yes. Sure.
> 
> > 
> > > Is there a way to pattern match all targets containing "clean"?
> > > 
> > > (Would have looked into it myself but -ETIME today)
> > 
> > I couldn't persuade filter to match against patterns with multiple %
> > so this was the best I could come up with.
> > 
> 
> OK.

If I hear no objection or suggestion for improvement today I will commit
this patch.

Wei.

> 
> Wei.
Ian Jackson Jan. 10, 2020, 5:51 p.m. UTC | #5
Paul Durrant writes ("[PATCH] tools/Rules.mk: fix distclean"):
> Running 'make distclean' under tools will currently result in:
> 
> tools/Rules.mk:245: *** You have to run ./configure before building or installing the tools.  Stop.
> 
> This patch adds 'distclean', 'subdir-distclean%' and 'subdir-clean%' to
> no-configure-targets, which allows 'make distclean' to run to completion.

This seems sound to me, even though I think in the case where it makes
a difference, `make distclean' will end up skipping most of the tools
stuff since the makefiles aren't present.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Wei, do you agree with my analysis ?

Ian.
Wei Liu Jan. 14, 2020, 11:24 a.m. UTC | #6
On Fri, Jan 10, 2020 at 05:51:06PM +0000, Ian Jackson wrote:
> Paul Durrant writes ("[PATCH] tools/Rules.mk: fix distclean"):
> > Running 'make distclean' under tools will currently result in:
> > 
> > tools/Rules.mk:245: *** You have to run ./configure before building or installing the tools.  Stop.
> > 
> > This patch adds 'distclean', 'subdir-distclean%' and 'subdir-clean%' to
> > no-configure-targets, which allows 'make distclean' to run to completion.
> 
> This seems sound to me, even though I think in the case where it makes
> a difference, `make distclean' will end up skipping most of the tools
> stuff since the makefiles aren't present.
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> Wei, do you agree with my analysis ?

Yes.

Wei.

> 
> Ian.
diff mbox series

Patch

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 31cf419ef4..52f47be3f8 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -239,7 +239,7 @@  subdir-all-% subdir-clean-% subdir-install-% subdir-uninstall-%: .phony
 subdir-distclean-%: .phony
 	$(MAKE) -C $* distclean
 
-no-configure-targets := clean subtree-force-update-all %-dir-force-update
+no-configure-targets := distclean subdir-distclean% clean subdir-clean% subtree-force-update-all %-dir-force-update
 ifeq (,$(filter $(no-configure-targets),$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Tools.mk:
 	$(error You have to run ./configure before building or installing the tools)