From owner-freebsd-bugs Thu Feb 4 21:26:55 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA27952 for freebsd-bugs-outgoing; Thu, 4 Feb 1999 21:26:55 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA27939 for ; Thu, 4 Feb 1999 21:26:51 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id QAA11941; Fri, 5 Feb 1999 16:26:42 +1100 Date: Fri, 5 Feb 1999 16:26:42 +1100 From: Bruce Evans Message-Id: <199902050526.QAA11941@godzilla.zeta.org.au> To: fenner@parc.xerox.com, freebsd-bugs@FreeBSD.ORG Subject: Re: misc/9913: make release would fail for lack of /etc/resolv.conf or $DISTFILES/ Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > Interesting! The '-' line and '+' lines are exactly same. > > What is changed? > > The return value to make, which determines whether or not it continues. > > mango% cat makefile > a: > [ -f /tmp/nosuch ] && echo hi > echo Won't get here! > > b: > if [ -f /tmp/nosuch ]; then \ > echo hi; \ > fi > @echo Got here! > mango% make a > [ -f /tmp/nosuch ] && echo hi > *** Error code 1 The && operator should be avoided anyway since it tends to break parallel makes: $ make -j1 a [ -f /tmp/nosuch ] && echo hi echo Will get here with -j!!! Will get here with -j!!! Fix: use ';' instead of '&&' when you want an early exit. See the cvs logs of /usr/src/Makefile, rev.177 for more details. I prefer to use one-liners with `|| true' instead of if statements to avoid early exits. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message