Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site Gregorio.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!CSL-Vax!Gregorio!mogul
From: mogul@Gregorio.ARPA
Newsgroups: net.bugs.4bsd
Subject: "Make" manual doesn't match code
Message-ID: <160@Gregorio.ARPA>
Date: Fri, 30-Nov-84 17:13:18 EST
Article-I.D.: Gregorio.160
Posted: Fri Nov 30 17:13:18 1984
Date-Received: Sun, 2-Dec-84 05:43:09 EST
Distribution: net
Organization: Stanford University
Lines: 44

Index:	bin/make/gram.y 4.2BSD

Description:
	The user's guide for "make" (/usr/doc/make) says
	
	  "There is also a comment convention: all characters after a
	  sharp (#) are ignored, as is the sharp itself."
	
	and
	
	  "A command is any string of characters not including a sharp
	  (except in quotes) or newline."

	The manual page (/usr/man/man1) is less explicit:
	
	  "Sharp and newline surround comments"

	Neither document is correct.  A sharp is treated as a comment
	character, whether surrounded by quotes or not, wherever it
	appears EXCEPT if it appears in a command.  If it appears in
	a command, it is passed to the shell untouched.  (A command is
	the tail of any line following a ";", or any line started by a
	tab.)
	
	This makes it impossible, for example, to define a "macro" with
	an embedded "#".

Repeat-By:
	call this "makefile" and run make:
	################################################################
	MACRO = "# fails"
	
	all: works fails
	
	works:
		echo "# works"
		echo # works too

	fails:
		echo $(MACRO)
	################################################################
	When I run it, it doesn't print "# fails".