Subject: bin/3556: make depend of bc fails if there is obj directory
To: None <gnats-bugs@gnats.netbsd.org>
From: None <enami@ba2.so-net.or.jp>
List: netbsd-bugs
Date: 04/30/1997 08:04:17
>Number:         3556
>Category:       bin
>Synopsis:       make depend of bc fails if there is obj directory
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 29 16:20:01 1997
>Last-Modified:
>Originator:     enami tsugutomo
>Organization:
	an individual
>Release:        NetBSD-current 1997 Apr 28
>Environment:
System: NetBSD pavlov.enami.ba2.so-net.or.jp 1.2D NetBSD 1.2D (PAVLOV) #241: Tue Apr 29 11:00:42 JST 1997 enami@pavlov.enami.ba2.so-net.or.jp:/b/netbsd/kernel/compile/PAVLOV i386


>Description:
	`make depend' of bc fails if there is obj directory.  It fails
	to create bc.c and/or bc.h.

>How-To-Repeat:

Script started on Wed Apr 30 07:44:42 1997
enami@pavlov% cd /usr/src/gnu/usr.bin/bc
enami@pavlov% ls -ld obj/
drwxr-xr-x   2 enami    wheel         512 Apr 29 12:04 obj/
enami@pavlov% /usr/bin/make depend
yacc -d bc.y
yacc: f - cannot open "bc.y"
*** Error code 2

Stop.
enami@pavlov% exit

Script done on Wed Apr 30 07:45:04 1997

>Fix:
	Here is my fix (why ${.IMPSRC} is expaneded to null string if
	bc.c exists but bc.h doesn't exists?  That's why I used
	.ALLSRC instead).

Index: Makefile
===================================================================
RCS file: /a/cvsroot/NetBSD/src/gnu/usr.bin/bc/Makefile,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 Makefile
--- Makefile	1997/04/29 12:34:12	1.1.1.2
+++ Makefile	1997/04/29 22:42:41
@@ -11,8 +11,9 @@
 
 CLEANFILES+= bc.c scan.c bc.h
 
+beforedepend: bc.h
 bc.c bc.h: bc.y
-	$(YACC) -d bc.y
+	${YACC} -d ${.ALLSRC}
 	mv y.tab.c bc.c
 	mv y.tab.h bc.h
 
>Audit-Trail:
>Unformatted: