Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 1996 12:01:59 -0700 (PDT)
From:      Archie Cobbs <archie@whistle.com>
To:        freebsd-hackers@freebsd.org
Subject:   make bug
Message-ID:  <199605151902.MAA07498@bubba.whistle.com>

next in thread | raw e-mail | index | archive | help

Consider the following makefile:


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

    default:
	    @echo this should not get executed


The '.BEGIN' tag just causes whatever commands listed to get executed
before any other stuff happens. You would think that the execution of
/usr/bin/false causes the make to fail, but instead it keeps on going:


    $ make
    aborting initialization
    /usr/bin/false
    this should not get executed
    *** Error code 1$


Also, there's that missing carriage-return at the end.

Personally, I would call this a bug. However, some might argue that
the '.BEGIN' tag is somehow special and should be immune to errors.
I don't know why they would argue this, however.

May I suggest a patch? This seems to fix it, at least for the above
example.


*** 1.3	1995/05/30 06:31:49
--- compat.c	1996/05/15 18:53:43
***************
*** 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);
+ 	    }
  	}
      }
  

Thanks,
-Archie

___________________________________________________________________________
Archie L. Cobbs, archie@whistle.com  *  Whistle Communications Corporation



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605151902.MAA07498>