Subject: bin/10264: make(1) .for does not handle vars in modifiers of iterators
To: None <>
From: Simon J. Gerraty <>
List: netbsd-bugs
Date: 06/02/2000 04:27:13
>Number:         10264
>Category:       bin
>Synopsis:       .for does not handle vars in modifiers of iterators
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 02 04:28:01 PDT 2000
>Originator:     Simon J. Gerraty
>Release:        NetBSD 2000-06-02
Zen Programming...
System: NetBSD 1.4.2 NetBSD 1.4.2 (ZEN) #2: Wed Mar 22 01:07:26 EST 2000 i386

The recent change to the implementation of .for - using a separate context
which is only searched for iterator variables so that normal code paths
through Var_Parse etc can be used, breaks makefiles which use a variable
to modify an iterator as in the example below.

.for f in foo.txt
${f:S/$/${GLOBAL}/}:	${f}
	@echo "$f -> ${.TARGET}"

$ touch
$ make
make: don't know how to make Stop

instead of:
$ make ->

More complex Makefiles bomb with a "graph cycles through ..." error.

Use make(1) with for.c v1.9 and var.c v1.4[67]

Don't have one.  It might be possible to be a bit more clever with Var_Find
when expanding variables from VAR_FOR, but I can't say.  The new code looks
cleaner, so if it can be made to work great.