Subject: bin/40: pmake broken ?
To: None <gnats-admin>
From: Frank Kardel <Frank.Kardel@informatik.uni-erlangen.de>
List: netbsd-bugs
Date: 12/11/1993 02:20:10
>Number:         40
>Category:       bin
>Synopsis:       {p,}make woes (parameter passing? / submakes)
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 11 02:20:06 1993
>Originator:     Frank Kardel
>Organization:
	Friedrich-Alexander-Universitaet Erlangen-Nuernberg
>Release:        NetBSD 0.9 (PC / Mac II) / BSDI(reported to me)
>Environment:
    	MacII

>Description:

Here goes the message that I also posted to comp.os.386bsd.bugs:

During the makefile overhalut for xntp3.3b I have discovered a strange
make behaviour with man on BSDI/NetBSD/FreeBSD.

1)
	Shell lines of the following form pass only one
	argument to the command instead of two when ARG1
	id empty and ARG2 is set to some string:

	target: dependencies
		command '$(ARG1)' '$(ARG2)'

	This leaves out one positional argument usually causing
	the command to fail. No other make on the system where
	xntp has been ported to seems to exhibit this unexpected
	behaviour. (The command should be executed as
	"command '' '<something>'", but is executed as
	"command '<something>'", although make prints that it
	will execute
	"command '' '<something>'. Thus it seems that the actual
	exec part of pmake is severly broken.

2)
	Following Makefile construction fails for no
	apparent reason (at least to me)
	doit:
		$(MAKE) MAKE=\"$(MAKE)\" all

	all:
		@echo all done.

	The above Makefile works ok if make is invoked by
	"make".
	However, it fails if it is invoked by
	"make MAKE=make" with the message 
	"make: don't know how to make make. Stop", which i would
	call at least "unconventional".
	Things seem to get better if additional option are specified
	hinting at a bug in argument parsing.
	A workaround for this problem is to call make following way:
	"make -e MAKE=make".

As I have received messages from BSDI, FreeBSD and NetBSD users i
suspect these make features being present in all versions of xBSD.
As I haven't found any reason yet why the above construction may be
illegal I would like to get them fixed (in all BSD versions). 

>How-To-Repeat:
	Makefile:
	doit:
		$(MAKE) MAKE=\"$(MAKE)\" all

	all:
		@echo all done.
	Try:
	make
	make MAKE=make
	make -e MAKE=make

>Fix:
	make -e MAKE=make works for now (but is no real solution)
>Audit-Trail:
>Unformatted:

------------------------------------------------------------------------------