From keramida@ceid.upatras.gr  Sat Jun 23 12:49:48 2001
Return-Path: <keramida@ceid.upatras.gr>
Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5])
	by hub.freebsd.org (Postfix) with ESMTP id 9DC5337B406
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 23 Jun 2001 12:49:45 -0700 (PDT)
	(envelope-from keramida@ceid.upatras.gr)
Received: from hades.hell.gr (patr530-a210.otenet.gr [212.205.215.210])
	by mailsrv.otenet.gr (8.11.1/8.11.1) with ESMTP id f5NJnfx15953;
	Sat, 23 Jun 2001 22:49:41 +0300 (EEST)
Received: (from charon@localhost)
	by hades.hell.gr (8.11.4/8.11.3) id f5NHl4003740;
	Sat, 23 Jun 2001 20:47:04 +0300 (EEST)
	(envelope-from keramida@ceid.upatras.gr)
Message-Id: <20010623204703.B3506@hades.hell.gr>
Date: Sat, 23 Jun 2001 20:47:04 +0300
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: Jens.Schweikhardt@marconi.com
Cc: freebsd-gnats-submit@FreeBSD.org
In-Reply-To: <200101161044.f0GAiCb28930@freefall.freebsd.org>; from Jens.Schweikhardt@marconi.com on Tue, Jan 16, 2001 at 02:44:12AM -0800
Subject: Re: make(1) does not correctly substitute in internal macros like $(@F:.o=.c)
References: <200101161044.f0GAiCb28930@freefall.freebsd.org>

>Number:         28373
>Category:       bin
>Synopsis:       Re: make(1) does not correctly substitute in internal macros like $(@F:.o=.c)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 23 12:50:03 PDT 2001
>Closed-Date:    Sun Jul 22 07:39:05 PDT 2001
>Last-Modified:  Wed Oct 26 06:40:04 GMT 2005
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 On Tue, Jan 16, 2001 at 02:44:12AM -0800, Jens.Schweikhardt@marconi.com wrote:
 
 > >Description:
 > 
 > It seems, make(1) doesn't understand substitutions in what the POSIX
 > standard calls internal variables ($@, $%, $?, $< and $*).
 > In the following example, the intent is to substitute any *.o in a *.c,
 > i.e. echo foo.c.
 > 
 > >How-To-Repeat:
 > $ cat Makefile                  
 > .POSIX:
 > foo.o:
 >         echo $(@F:.o=.c)
 > $ /usr/bin/make
 > echo foo.o.o=.c)
 > Syntax error: ")" unexpected
 > *** Error code 2
 > 
 > Stop in /usr/home/sje2bk.
 
 Jens, are you sure this problem still persists to bug you?
 
 Well, the syntax is slightly different in the make(1) program I have
 on my 5.0-CURRENT, and by looking at the CVS logs, it seems that its
 been like that for a while.  The way that BSD make does substitution
 in variables, special or not is described in the paper found at
 /usr/share/doc/psd/12.make/paper.* and an example of it is shown
 below:
 
 
 	% cat Makefile
 
 	SRCS=	main.c foo.c
 	
 	OBJS=	${SRCS:S/.c/.o/g}
 	
 	.c.o:
 		echo Building $@ from ${@:S/.o/.c/g}
 	
 	default: ${OBJS}
 		echo 'Done.'
 
 	% touch main.c foo.c
 
 	% make -s
 
 	Building main.o from main.c
 	Building foo.o from foo.c
 	Done.
 
 Am afraid that I don't know if POSIX specifies a different syntax than
 the ${VARIABLE:modifier} that BSD make uses.  On the other hand, the
 version of GNU make that I have says in its manuals that substitution
 in variables works a little differently than what you wrote.
 
 	% cat GNUmakefile 
 	
 	SRCS=   main.c foo.c
 	
 	OBJS=   $(SRCS:%.c=%.o)
 	
 	all:
 		echo $(OBJS)
 	
 	% gmake -f GNUmakefile 
 	
 	echo main.o foo.o
 	main.o foo.o
 
 I think we can close this PR, if thats ok with you Jens too.
 
 -giorgos
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Mon Jun 25 17:34:39 PDT 2001 
Responsible-Changed-Why:  
Misfiled. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28373 
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Sun Jul 22 07:39:05 PDT 2001 
State-Changed-Why:  
response to another pr 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28373 
>Unformatted:
