[PATCH (mtd-utils)] Makefile: fix "make clean" for old GNU find

Artem Bityutskiy dedekind1 at gmail.com
Fri Mar 9 04:41:39 EST 2012


On Thu, 2012-03-08 at 09:52 -0800, Brian Norris wrote:
> On Thu, Mar 8, 2012 at 8:54 AM, Mike Frysinger <vapier.adi at gmail.com> wrote:
> > On Fri, Mar 2, 2012 at 17:17, Brian Norris <computersforpeace at gmail.com> wrote:
> >> However, it will launch a lot more `rm' processes...
> >
> > indeed, that does suck.  you could do this, but it kind of sucks too ...
> > CLEAN_FIND = find "$(BUILDDIR)/" -xdev '(' -name '*.[ao]' -o -name
> > '.*.c.dep' ')'
> > ...
> >    @if test -d "$(BUILDDIR)/"; then
> >        $(CLEAN_FIND) -exec rm -f {} + 2>/dev/null || \
> >        $(CLEAN_FIND) -exec rm -f {} \; ; \
> >    fi
> 
> I'm fine with that too. It's a little uglier, but it's not quite as
> bad for systems that have a modern `find', I think. I'll resend with
> your suggestion if there are no better suggestions.

May be adding a one-line comment like "work-around for ancient find
utils not supporting '+'" would also be a good idea?

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list