Makefile and secondexpansion

Hi.
I am reading a tutorial about make and I saw some example and I don't understand it.

Why this makefile is printing this:

/tmp/foo/foo.c
/tmp/bar/foo.c
/tmp/foo.o

1
2
3
4
5
6
7
8
.SECONDEXPANSION
/tmp/foo.o

%.c
    @echo $@

%.o $$(addsuffix /%.c,foo bar)
    @echo $@


Why bar is in the middle?
% should be "/tmp/foo" and this should be added to end so why I didn't get bar/tmp/foo.c?
Last edited on
Topic archived. No new replies allowed.