diff mbox series

[XEN,v7,22/51] build: clean common temporary files from root makefile

Message ID 20210824105038.1257926-23-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen: Build system improvements, now with out-of-tree build! | expand

Commit Message

Anthony PERARD Aug. 24, 2021, 10:50 a.m. UTC
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Makefile               | 1 +
 xen/scripts/Makefile.clean | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Jan Beulich Oct. 11, 2021, 11:41 a.m. UTC | #1
On 24.08.2021 12:50, Anthony PERARD wrote:
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Trying to synthesize a description:

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -382,6 +382,7 @@ _clean:
>  	$(MAKE) $(clean) test
>  	$(MAKE) $(kconfig) clean
>  	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \

This was effectively redundant with ...

> +		-o -name ".*.o.tmp" -o -name "*~" -o -name "core" \
>  		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
>  	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
>  	rm -f asm-offsets.s arch/*/include/asm/asm-offsets.h
> diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean
> index 027c200c0efc..b6df9e861e6e 100644
> --- a/xen/scripts/Makefile.clean
> +++ b/xen/scripts/Makefile.clean
> @@ -14,10 +14,8 @@ include Makefile
>  subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
>                $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-)))
>  
> -DEPS_RM = $(DEPS) $(DEPS_INCLUDE)

... this and its use below.

>  .PHONY: clean
>  clean:: $(subdir-all)
> -	rm -f *.o .*.o.tmp *~ core $(DEPS_RM)

With the command gone, I think the :: should also be converted (back) to
just : then. Then
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Assuming the patch is independent of the earlier still uncommitted ones
(please confirm), I'd be happy to make the adjustment while committing
- as long as you agree, of course.

Jan
Anthony PERARD Oct. 13, 2021, 10:36 a.m. UTC | #2
On Mon, Oct 11, 2021 at 01:41:16PM +0200, Jan Beulich wrote:
> On 24.08.2021 12:50, Anthony PERARD wrote:
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> Trying to synthesize a description:
> 
> > --- a/xen/Makefile
> > +++ b/xen/Makefile
> > @@ -382,6 +382,7 @@ _clean:
> >  	$(MAKE) $(clean) test
> >  	$(MAKE) $(kconfig) clean
> >  	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
> 
> This was effectively redundant with ...
> 
> > +		-o -name ".*.o.tmp" -o -name "*~" -o -name "core" \
> >  		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
> >  	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
> >  	rm -f asm-offsets.s arch/*/include/asm/asm-offsets.h
> > diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean
> > index 027c200c0efc..b6df9e861e6e 100644
> > --- a/xen/scripts/Makefile.clean
> > +++ b/xen/scripts/Makefile.clean
> > @@ -14,10 +14,8 @@ include Makefile
> >  subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
> >                $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-)))
> >  
> > -DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
> 
> ... this and its use below.
> 
> >  .PHONY: clean
> >  clean:: $(subdir-all)
> > -	rm -f *.o .*.o.tmp *~ core $(DEPS_RM)
> 
> With the command gone, I think the :: should also be converted (back) to
> just : then. Then

"clean" has been a double-column rule for a long time. If we convert
this rule to a single-column we need to convert all "clean" target to
use single-column which would make this patch more complicated. So I
don't think we should make this change.

> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Assuming the patch is independent of the earlier still uncommitted ones
> (please confirm), I'd be happy to make the adjustment while committing
> - as long as you agree, of course.

The patch is independent of earlier one, although the context is changed
in one patch so wouldn't apply cleaning without git helps.
(context is changed in "xen: move include/asm-* to arch/*/include/asm")

Thanks,
Jan Beulich Oct. 13, 2021, 12:32 p.m. UTC | #3
On 13.10.2021 12:36, Anthony PERARD wrote:
> On Mon, Oct 11, 2021 at 01:41:16PM +0200, Jan Beulich wrote:
>> On 24.08.2021 12:50, Anthony PERARD wrote:
>>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>>
>> Trying to synthesize a description:
>>
>>> --- a/xen/Makefile
>>> +++ b/xen/Makefile
>>> @@ -382,6 +382,7 @@ _clean:
>>>  	$(MAKE) $(clean) test
>>>  	$(MAKE) $(kconfig) clean
>>>  	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
>>
>> This was effectively redundant with ...
>>
>>> +		-o -name ".*.o.tmp" -o -name "*~" -o -name "core" \
>>>  		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
>>>  	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
>>>  	rm -f asm-offsets.s arch/*/include/asm/asm-offsets.h
>>> diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean
>>> index 027c200c0efc..b6df9e861e6e 100644
>>> --- a/xen/scripts/Makefile.clean
>>> +++ b/xen/scripts/Makefile.clean
>>> @@ -14,10 +14,8 @@ include Makefile
>>>  subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
>>>                $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-)))
>>>  
>>> -DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
>>
>> ... this and its use below.
>>
>>>  .PHONY: clean
>>>  clean:: $(subdir-all)
>>> -	rm -f *.o .*.o.tmp *~ core $(DEPS_RM)
>>
>> With the command gone, I think the :: should also be converted (back) to
>> just : then. Then
> 
> "clean" has been a double-column rule for a long time. If we convert
> this rule to a single-column we need to convert all "clean" target to
> use single-column which would make this patch more complicated. So I
> don't think we should make this change.

Hmm, indeed make would complain in that case (I didn't mean to suggest
to convert all clean-s to single-colon rules, but I was instead under
the wrong impression that spelling out merely dependencies would be
okay with single-colon rule). But then make's doc also says "Each
double-colon rule should specify a recipe; if it does not, an implicit
rule will be used if one applies." So perhaps, to avoid depending on
the latter, an empty recipe should be added here (by adding a
semicolon)?

>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>
>> Assuming the patch is independent of the earlier still uncommitted ones
>> (please confirm), I'd be happy to make the adjustment while committing
>> - as long as you agree, of course.
> 
> The patch is independent of earlier one, although the context is changed
> in one patch so wouldn't apply cleaning without git helps.
> (context is changed in "xen: move include/asm-* to arch/*/include/asm")

That would be easy enough to adjust, I guess. But first we need to settle
on the above.

Jan
Anthony PERARD Oct. 13, 2021, 2:26 p.m. UTC | #4
On Wed, Oct 13, 2021 at 02:32:55PM +0200, Jan Beulich wrote:
> On 13.10.2021 12:36, Anthony PERARD wrote:
> > On Mon, Oct 11, 2021 at 01:41:16PM +0200, Jan Beulich wrote:
> >> On 24.08.2021 12:50, Anthony PERARD wrote:
> >>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> >>
> >> Trying to synthesize a description:
> >>
> >>> --- a/xen/Makefile
> >>> +++ b/xen/Makefile
> >>> @@ -382,6 +382,7 @@ _clean:
> >>>  	$(MAKE) $(clean) test
> >>>  	$(MAKE) $(kconfig) clean
> >>>  	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
> >>
> >> This was effectively redundant with ...
> >>
> >>> +		-o -name ".*.o.tmp" -o -name "*~" -o -name "core" \
> >>>  		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
> >>>  	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
> >>>  	rm -f asm-offsets.s arch/*/include/asm/asm-offsets.h
> >>> diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean
> >>> index 027c200c0efc..b6df9e861e6e 100644
> >>> --- a/xen/scripts/Makefile.clean
> >>> +++ b/xen/scripts/Makefile.clean
> >>> @@ -14,10 +14,8 @@ include Makefile
> >>>  subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
> >>>                $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-)))
> >>>  
> >>> -DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
> >>
> >> ... this and its use below.
> >>
> >>>  .PHONY: clean
> >>>  clean:: $(subdir-all)
> >>> -	rm -f *.o .*.o.tmp *~ core $(DEPS_RM)
> >>
> >> With the command gone, I think the :: should also be converted (back) to
> >> just : then. Then
> > 
> > "clean" has been a double-column rule for a long time. If we convert
> > this rule to a single-column we need to convert all "clean" target to
> > use single-column which would make this patch more complicated. So I
> > don't think we should make this change.
> 
> Hmm, indeed make would complain in that case (I didn't mean to suggest
> to convert all clean-s to single-colon rules, but I was instead under
> the wrong impression that spelling out merely dependencies would be
> okay with single-colon rule). But then make's doc also says "Each
> double-colon rule should specify a recipe; if it does not, an implicit
> rule will be used if one applies." So perhaps, to avoid depending on
> the latter, an empty recipe should be added here (by adding a
> semicolon)?

That sounds fine.

> >> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> >>
> >> Assuming the patch is independent of the earlier still uncommitted ones
> >> (please confirm), I'd be happy to make the adjustment while committing
> >> - as long as you agree, of course.
> > 
> > The patch is independent of earlier one, although the context is changed
> > in one patch so wouldn't apply cleaning without git helps.
> > (context is changed in "xen: move include/asm-* to arch/*/include/asm")
> 
> That would be easy enough to adjust, I guess. But first we need to settle
> on the above.

Thanks,
diff mbox series

Patch

diff --git a/xen/Makefile b/xen/Makefile
index 1dad20a95be6..f07c9251c030 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -382,6 +382,7 @@  _clean:
 	$(MAKE) $(clean) test
 	$(MAKE) $(kconfig) clean
 	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
+		-o -name ".*.o.tmp" -o -name "*~" -o -name "core" \
 		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
 	rm -f asm-offsets.s arch/*/include/asm/asm-offsets.h
diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean
index 027c200c0efc..b6df9e861e6e 100644
--- a/xen/scripts/Makefile.clean
+++ b/xen/scripts/Makefile.clean
@@ -14,10 +14,8 @@  include Makefile
 subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
               $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-)))
 
-DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
 .PHONY: clean
 clean:: $(subdir-all)
-	rm -f *.o .*.o.tmp *~ core $(DEPS_RM)
 
 # Descending
 # ---------------------------------------------------------------------------