From archie@whistle.com  Tue May 21 16:06:14 1996
Received: from whistle.com ([207.76.205.131])
          by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id QAA08393
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 May 1996 16:06:13 -0700 (PDT)
Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id QAA00872 for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 May 1996 16:05:41 -0700 (PDT)
Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3)
	id sma000870; Tue May 21 16:05:36 1996
Received: (from archie@localhost) by bubba.whistle.com (8.6.12/8.6.12) id QAA20668; Tue, 21 May 1996 16:05:35 -0700
Message-Id: <199605212305.QAA20668@bubba.whistle.com>
Date: Tue, 21 May 1996 16:05:35 -0700
From: Archie Cobbs <archie@whistle.com>
Reply-To: archie@whistle.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: make(1) execution of ``.BEGIN'' does not halt on error
X-Send-Pr-Version: 3.2

>Number:         1231
>Category:       bin
>Synopsis:       make(1) execution of ``.BEGIN'' does not halt on error
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    steve
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 21 16:10:05 PDT 1996
>Closed-Date:    Tue Sep 24 19:49:57 PDT 1996
>Last-Modified:  Tue Sep 24 19:57:02 PDT 1996
>Originator:     Archie Cobbs
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
Whistle Communications, Inc.
>Environment:

	FreeBSD-2.1R, 2.2-current, ??

>Description:

	When the special ``.BEGIN'' target is used to have a list
	of commands execute at the beginning of the make, and one
	of those commands fails, make(1) does not halt execution
	as it should.

>How-To-Repeat:

	Run make on this makefile:

		.BEGIN:
			@echo aborting initialization
			/usr/bin/false

		default:
			@echo this should not get executed

>Fix:

	Apply the following patch in the main source directory:

Index: compat.c
===================================================================
RCS file: /tribe/cvs/freebsd/src/usr.bin/make/compat.c,v
retrieving revision 1.3
diff -c -r1.3 compat.c
*** 1.3	1995/05/30 06:31:49
--- compat.c	1996/05/18 23:39:38
***************
*** 615,620 ****
--- 615,624 ----
  	gn = Targ_FindNode(".BEGIN", TARG_NOCREATE);
  	if (gn != NILGNODE) {
  	    Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn);
+ 	    if (gn->made == ERROR) {
+ 		printf ("\n\nStop.\n");
+ 		exit (1);
+ 	    }
  	}
      }
  
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->steve 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Tue Sep 24 17:28:55 PDT 1996 
Responsible-Changed-Why:  
Steve's area. 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Tue Sep 24 19:49:57 PDT 1996 
State-Changed-Why:  
Fixed in revision 1.4 of compat.c.  Thanks for the 
patch Archie. 
>Unformatted:
