Subject: kern/9567: .BEGIN targets use depencencies
To: None <gnats-bugs@gnats.netbsd.org>
From: None <arnej@pvv.org>
List: netbsd-bugs
Date: 03/07/2000 13:15:51
>Number:         9567
>Category:       kern
>Synopsis:       .BEGIN targets use depencencies
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar  7 13:15:00 2000
>Last-Modified:
>Originator:     Arne H Juul
>Organization:
PVV.org
>Release:        NetBSD-current as of Mar 7 2000
>Environment:

System: NetBSD nocturne.fast.no 1.4T NetBSD 1.4T (NOCTURNE) #4: Sat Feb 26 14:01:58 CET 2000 arnej@nocturne.fast.no:/usr/src/sys/arch/i386/compile/NOCTURNE i386

>Description:
	The following Makefiles use dependencies for .BEGIN
	(and in one case .INTERRUPT):
./distrib/mac68k/instkernel/ramdisk/Makefile:.INTERRUPT: unconfig
./sys/arch/i386/stand/installboot/Makefile:.BEGIN: machine
./sys/arch/i386/stand/Makefile.booters:.BEGIN: machine
./sys/arch/pmax/stand/Makefile.booters:.BEGIN: machine pmax mips
./sys/arch/news68k/stand/boot/Makefile:.BEGIN: machine m68k
./sys/arch/news68k/stand/bootxx/Makefile:.BEGIN: machine m68k
./sys/arch/news68k/stand/common/Makefile:.BEGIN: machine m68k

>How-To-Repeat:
	Note that "make depend" fails in sys/arch/i386/stand/biosboot,
	wonder why the "machine" symlinks isn't created early enough,
	note that the "machine" target is used as a dependency for
	.BEGIN, probably in an attempt to fix the problem.
	This doesn't work as expected, see also PR bin/9566.

>Fix:
	Apply following patch:

Index: ./distrib/mac68k/instkernel/ramdisk/Makefile
===================================================================
RCS file: /cvs/basesrc/distrib/mac68k/instkernel/ramdisk/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	1999/12/17 20:48:08	1.3
+++ Makefile	2000/03/07 21:09:27
@@ -55,7 +55,8 @@
 	/bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \
 	    *.o *.cro *.c INSTALL.more
 
-.INTERRUPT: unconfig
+.INTERRUPT:
+	$(MAKE) unconfig
 
 .include <bsd.own.mk>
 .include <bsd.obj.mk>
Index: ./sys/arch/i386/stand/installboot/Makefile
===================================================================
RCS file: /cvs/syssrc/sys/arch/i386/stand/installboot/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- Makefile	2000/01/23 16:45:54	1.16
+++ Makefile	2000/03/07 21:09:31
@@ -19,9 +19,8 @@
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes
 LDSTATIC?=-static
 
-.BEGIN: machine
 .NOPATH: machine
-realdepend realall: machine
+depend realall: machine
 CLEANFILES+= machine
 
 machine::
Index: ./sys/arch/i386/stand/Makefile.booters
===================================================================
RCS file: /cvs/syssrc/sys/arch/i386/stand/Makefile.booters,v
retrieving revision 1.25
diff -u -r1.25 Makefile.booters
--- Makefile.booters	2000/01/23 16:44:18	1.25
+++ Makefile.booters	2000/03/07 21:09:35
@@ -19,9 +19,8 @@
 
 CLEANFILES+= vers.c vers.o ${BASE}.list
 
-.BEGIN: machine
 .NOPATH: machine
-realdepend realall: machine
+depend realall: machine
 CLEANFILES+= machine
 
 machine::
Index: ./sys/arch/pmax/stand/Makefile.booters
===================================================================
RCS file: /cvs/syssrc/sys/arch/pmax/stand/Makefile.booters,v
retrieving revision 1.28
diff -u -r1.28 Makefile.booters
--- Makefile.booters	2000/01/23 17:04:07	1.28
+++ Makefile.booters	2000/03/07 21:09:40
@@ -3,8 +3,7 @@
 # $S must correspond to the top of the 'sys' tree
 S=	${.CURDIR}/../../../..
 
-.BEGIN: machine pmax mips
-${PROG} realdepend realall: machine pmax mips
+${PROG} depend realall: machine pmax mips
 CLEANFILES+= machine pmax mips
 machine:
 	-rm -f ${.TARGET}
Index: ./sys/arch/news68k/stand/boot/Makefile
===================================================================
RCS file: /cvs/syssrc/sys/arch/news68k/stand/boot/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	2000/02/01 05:25:41	1.4
+++ Makefile	2000/03/07 21:09:44
@@ -31,9 +31,8 @@
 L= ${COMMONOBJ}/lib
 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
 
-.BEGIN: machine m68k
 .NOPATH: machine m68k
-realdepend realall: machine m68k
+depend realall: machine m68k
 
 machine::
 	-rm -f $@
Index: ./sys/arch/news68k/stand/bootxx/Makefile
===================================================================
RCS file: /cvs/syssrc/sys/arch/news68k/stand/bootxx/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	2000/01/23 17:04:06	1.2
+++ Makefile	2000/03/07 21:09:48
@@ -30,9 +30,8 @@
 L= ${COMMONOBJ}/lib
 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a
 
-.BEGIN: machine m68k
 .NOPATH: machine m68k
-realdepend realall: machine m68k
+depend realall: machine m68k
 
 machine::
 	-rm -f $@
Index: ./sys/arch/news68k/stand/common/Makefile
===================================================================
RCS file: /cvs/syssrc/sys/arch/news68k/stand/common/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	2000/01/23 17:04:06	1.2
+++ Makefile	2000/03/07 21:09:52
@@ -12,9 +12,8 @@
 
 CLEANFILES+= machine m68k
 
-.BEGIN: machine m68k
 .NOPATH: machine m68k
-realdepend realall: machine m68k
+depend realall: machine m68k
 
 machine::
 	-rm -f $@
>Audit-Trail:
>Unformatted: