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

Mike Frysinger vapier.adi at gmail.com
Thu Mar 8 11:54:02 EST 2012


On Fri, Mar 2, 2012 at 17:17, Brian Norris <computersforpeace at gmail.com> wrote:
> findutils v4.1.x does not have the `-exec CMD {} +' syntax. We can just as
> easily use the `-exec CMD {} \;' syntax.

really it's a workaround for old tools that don't adhere to the new POSIX spec

> 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
...
-mike



More information about the linux-mtd mailing list