On Mon, 29 Oct 2012, Niels Möller wrote:
Martin Storsjo martin@martin.st writes:
On Mac OS X 10.8 sed, the | operator isn't available in basic REs, only in extended ones. The null string also has to be expressed with ().
The first is understandable, but the second seems very odd to me, isn't that very buggy?
Not sure - with sed -E 's/.c(xx|)$//' I get:
sed: 1: "s/.c(xx|)$//": RE error: empty (sub)expression
Another Mac OS X-compatible version of the RE is 's/.c(xx){0,1}//'.
Both of these versions have been tested for compatibility with GNU sed.
I'd prefer if we stick to basic regular expression and posix sed (and the current regexp using | is not posix either). Your second variant should be fine with posix sed, if I understand http://pubs.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap09.html correctly. So I think that's the right fix.
Ok, I'll send a new patch with that approach instead then.
A third alternative is to omit generating these dummy deps altogether, and prefixing the include statements in the Makefiles with a '-', which haves make ignore any failures in including those files.
The current use of include works at least with GNU make and Solaris make, but not with BSD make (the latter wants only a single file name after include). Unfortunately, I think the -include trick fails to work with Solaris make.
Ok, good to know.
// Martin