Re: [Xen-devel] [PATCH v2] build: fix clean to remove all .o and .d files
> On Dec 2, 2015, at 9:36 AM, Jan Beulichwrote: > On 02.12.15 at 16:29, wrote: >> --- a/xen/Makefile >> +++ b/xen/Makefile >> @@ -91,7 +91,8 @@ _clean: delete-unfresh-files >> $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean >> $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean >> $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean >> -rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi >> $(TARGET)-syms *~ core $(DEPS) >> +find . \( -name "*.o" -o -name "*.d" \) -exec rm -f {} \; > > If you really meant *.d, then *.[od] would have done. But in fact I > think we want to limit this to ".*.d". Which I could fix up while > committing, but then I'm not sure … Easy enough to change it to “.*.d”. > >> --- a/xen/Rules.mk >> +++ b/xen/Rules.mk >> @@ -173,7 +173,7 @@ FORCE: >> >> .PHONY: clean >> clean:: $(addprefix _clean_, $(subdir-all)) >> -rm -f *.o *~ core $(DEPS) >> +rm -f *~ core > > ... this is a good idea, as it's not clear to me whether "clean" actually > works when invoked in sub-trees of xen/. I can definitely take that bit out; I just didn’t see the point in replicating the removal of the files. Note that, whether I take it out or leave it in, “clean” still will not totally work when invoked in sub-trees of xen/ because *.o is still not enough to catch all of the object files (which was the whole point of this patch in the first place). ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2] build: fix clean to remove all .o and .d files
> On Dec 2, 2015, at 9:46 AM, Jan Beulichwrote: > On 02.12.15 at 16:41, wrote: > >>> On Dec 2, 2015, at 9:36 AM, Jan Beulich wrote: >>> >> On 02.12.15 at 16:29, wrote: --- a/xen/Makefile +++ b/xen/Makefile @@ -91,7 +91,8 @@ _clean: delete-unfresh-files $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean - rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms >> *~ core $(DEPS) + find . \( -name "*.o" -o -name "*.d" \) -exec rm -f {} \; >>> >>> If you really meant *.d, then *.[od] would have done. But in fact I >>> think we want to limit this to ".*.d". Which I could fix up while >>> committing, but then I'm not sure … >> >> Easy enough to change it to “.*.d”. >> >>> --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -173,7 +173,7 @@ FORCE: .PHONY: clean clean:: $(addprefix _clean_, $(subdir-all)) - rm -f *.o *~ core $(DEPS) + rm -f *~ core >>> >>> ... this is a good idea, as it's not clear to me whether "clean" actually >>> works when invoked in sub-trees of xen/. >> >> I can definitely take that bit out; I just didn’t see the point in >> replicating the >> removal of the files. Note that, whether I take it out or leave it in, >> “clean” still >> will not totally work when invoked in sub-trees of xen/ because *.o is still >> not >> enough to catch all of the object files (which was the whole point of this >> patch >> in the first place). > > True, but let's not make matters worse. I'd be fine leaving this > second change in only if we knew "clean" doesn't work at all when > invoked against sub-trees of xen/. > > And again - no reason to re-submit, I can easily tweak the patch > upon commit, as long as you're fine with this being done with your > S-o-b in place. > Yeah, that is fine. ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2] build: fix clean to remove all .o and .d files
>>> On 02.12.15 at 16:29,wrote: > --- a/xen/Makefile > +++ b/xen/Makefile > @@ -91,7 +91,8 @@ _clean: delete-unfresh-files > $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean > $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean > $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean > - rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi > $(TARGET)-syms *~ core $(DEPS) > + find . \( -name "*.o" -o -name "*.d" \) -exec rm -f {} \; If you really meant *.d, then *.[od] would have done. But in fact I think we want to limit this to ".*.d". Which I could fix up while committing, but then I'm not sure ... > --- a/xen/Rules.mk > +++ b/xen/Rules.mk > @@ -173,7 +173,7 @@ FORCE: > > .PHONY: clean > clean:: $(addprefix _clean_, $(subdir-all)) > - rm -f *.o *~ core $(DEPS) > + rm -f *~ core ... this is a good idea, as it's not clear to me whether "clean" actually works when invoked in sub-trees of xen/. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2] build: fix clean to remove all .o and .d files
>>> On 02.12.15 at 16:41,wrote: >> On Dec 2, 2015, at 9:36 AM, Jan Beulich wrote: >> > On 02.12.15 at 16:29, wrote: >>> --- a/xen/Makefile >>> +++ b/xen/Makefile >>> @@ -91,7 +91,8 @@ _clean: delete-unfresh-files >>> $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean >>> $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean >>> $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean >>> - rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi >>> $(TARGET)-syms > *~ core $(DEPS) >>> + find . \( -name "*.o" -o -name "*.d" \) -exec rm -f {} \; >> >> If you really meant *.d, then *.[od] would have done. But in fact I >> think we want to limit this to ".*.d". Which I could fix up while >> committing, but then I'm not sure … > > Easy enough to change it to “.*.d”. > >> >>> --- a/xen/Rules.mk >>> +++ b/xen/Rules.mk >>> @@ -173,7 +173,7 @@ FORCE: >>> >>> .PHONY: clean >>> clean:: $(addprefix _clean_, $(subdir-all)) >>> - rm -f *.o *~ core $(DEPS) >>> + rm -f *~ core >> >> ... this is a good idea, as it's not clear to me whether "clean" actually >> works when invoked in sub-trees of xen/. > > I can definitely take that bit out; I just didn’t see the point in > replicating the > removal of the files. Note that, whether I take it out or leave it in, > “clean” still > will not totally work when invoked in sub-trees of xen/ because *.o is still > not > enough to catch all of the object files (which was the whole point of this > patch > in the first place). True, but let's not make matters worse. I'd be fine leaving this second change in only if we knew "clean" doesn't work at all when invoked against sub-trees of xen/. And again - no reason to re-submit, I can easily tweak the patch upon commit, as long as you're fine with this being done with your S-o-b in place. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [PATCH v2] build: fix clean to remove all .o and .d files
In commit 8b6ef9c152edceabecc7f90c811cd538a7b7a110, several files in xen/common/compat were changed to be built using the Makefile in xen/common, by appending the compat prefix to the object files. Additionally, the xen/common/compat directory was removed from the subdirs-y variable, so it is no longer visited by the clean rule. This resulted in some object files and dependency files being generated by inclusion into obj-y, but not cleaned because they lived in a directory that was unvisited by the clean rules. Since there is a desire for all of the object files and dependency files to be cleaned, just search for all objects and dependency files and delete them on clean. The previous method of only tracking with the $(DEPS) and *.o in the clean rules had the disadvantage that, if the configuration changed between a build and a clean, some of the dependencies or objects could get left behind. This method does not have the same disadvantage. CC: Ian CampbellCC: Ian Jackson CC: Jan Beulich CC: Keir Fraser CC: Tim Deegan Signed-off-by: Jonathan Creekmore --- xen/Makefile | 3 ++- xen/Rules.mk | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 3a1de99..365c477 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -91,7 +91,8 @@ _clean: delete-unfresh-files $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean - rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS) + find . \( -name "*.o" -o -name "*.d" \) -exec rm -f {} \; + rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core rm -f include/asm-*/asm-offsets.h rm -f .banner diff --git a/xen/Rules.mk b/xen/Rules.mk index 02db110..123a4a7 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -173,7 +173,7 @@ FORCE: .PHONY: clean clean:: $(addprefix _clean_, $(subdir-all)) - rm -f *.o *~ core $(DEPS) + rm -f *~ core _clean_%/: FORCE $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean -- 2.6.2 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel