>> note use of && rather than ; which can be very dangerous
>
>In standard scripts I would agree. In FreeBSD pmake, I would disagree,
>but it seems that it's the odd man out:

Yes, this is because FreeBSD make still uses the shell's -e
for error detection.
NetBSD (hence bmake) abandoned that quite a while ago, as it does more
harm that good.

I had a vague recollection that the posix man page covered this, but the
text is somewhat ambiguous.  Its descripton of using system() though is
probably why most makefile authors expect the command line to be the
unit of exection and thus success/failure.

        false || echo ok

works ok even with -e, but while most makes will print ok for this one
too:

        false; test $$? != 0 && echo ok

it will fail if -e is used.
That's a contrived example, but I know David had a fun real life example
a couple of years ago that was quite painful to workaround.

--sjg

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to