make - foreach function

I wrote the following Makefile:

 
dirs := a b c d
files := $(foreach dir,$(dirs),$(wildcard $(dir)/*))
.PHONY: all
all:
    touch $(files)

The first two lines are taken from GNU make tutorial, Section 8.5 The foreach Function. I would expect the recipe

    touch $(files)

to be expanded to

    touch a:/* b:/* c:/* d:/*

In fact, GNU Make 3.82 for Windows expands it to

    touch

Can anyone explain this behavior?

I cannot explain the behaviour. I have 3.81 installed (Linux) which complains wildly when I attempted to have it parse your makefile. This is syntax that I usually rely on when using gmake and needing to do something similar to what it appears you are trying:

dir = a b c d
files = ${dir:%=%:/*}

all:
        echo $(files)

When I execute gmake the output is:

$gmake
echo a:/* b:/* c:/* d:/*
a:/* b:/* c:/* d:/*

Don't know if that helps you out any, but thought it might be worth tossing out there.

Thanks, agama!
Is this syntax:

files = ${dir:%=%:/*}

explained in the GNU make tutorial? (I could not find it there.) If not, where can I read about it?