[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Use of non-portable find options in Makefile.in

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Mon, 03 Mar 2014 17:34:22 +0000

I've been experimenting with a SPARC Solaris build recently and the
non-portable use of find in Makefile.in is annoying, it means that the
'make clean' target fails. There are two uses of

  find some/path -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf --

Solaris find doesn't support -mindepth, -maxdepth or -print0.

Are we using -print0 because problems with spaces in paths have been
observed or simply as some sort of future-proofing? Don't we control
the paths thus allowing us to avoid spaces?

The use of -mindepth 1 -maxdepth 1 is also something I don't understand,
what advantage is there over simply using a shell expansion? Like this:

  rm -rf some/path/*

The shell expansion doesn't appear to have a problem with spaces when I
test it.

There is also one use of

  find some/path -print0 | xargs -0 rm -rf --

looking for gcov files. Have problems with spaces been observed or is
this also future-proofing?

I'd like to have a more portable Makefile.

Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2014-03-03 18:34:56 CET

This is an archived mail posted to the Subversion Dev mailing list.