Subject: bin/1523: make doesn't properly depend on .a files
To: None <gnats-bugs@NetBSD.ORG>
From: Chris G. Demetriou <cgd@NetBSD.ORG>
List: netbsd-bugs
Date: 09/26/1995 19:30:21
>Number:         1523
>Category:       bin
>Synopsis:       dependencies on .a files may not be dealt with properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 26 19:35:01 1995
>Originator:     Chris G. Demetriou
Kernel Hackers 'r' Us
>Release:        NetBSD-current (9/26/95 on NetBSD/alpha, 9/20/95 on i386)
System: NetBSD 1.0A NetBSD 1.0A (BUNNY) #497: Tue Aug 29 11:48:06 EDT 1995 alpha

and an i386 of Jason Thorpe's running -current.

	.a dependencies don't seem to work properly.
	for instance, given a dependency of the form:

	foo:    foolib.a

	make(1) will think it can build foo even if no foolib.a exists!

	a one-liner!
		/bin/rm -f foolib.a ; ls -la foolib.a ; make foolib.a

	or: unshar the Makefile below.  run make clean (to make
	sure that the named files aren't around), then run make -k.
	note that the 'bar' and 'baz' targets won't be built, but
	'foo' will.  'foo' is the only one that depends on a .a file.

	Note also that some Makefiles in the source tree depend
	on this behaviour, e.g. src/usr.sbin/sendmail/praliases,
	which DPADDs LIBDBM (which is defined as /usr/lib/libdbm.a),
	which doesn't exist.  (note that it doesn't LDADD a dbm library,
	and, in the presence of this bug, builds fine!)

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
# This archive contains:
#	Makefile
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
Xall:	foo bar baz
Xfoo:	foolib.a
X	touch foo
Xbar:	barlib
X	touch bar
Xbaz:	bazlib.o
X	touch baz
X	/bin/rm -f foo foolib.a bar barlib baz bazlib.o