Suppose I have a set of source files:
src/foo/file.abc
src/foo/otherfile.abc
that I want to do some operation on (for simplicity, let's just say copy) resulting in destination files in several different places:
dest/bar/file.xyz
dest/bar/otherfile.xyz
dest/baz/file.xyz
dest/baz/otherfile.xyz
dest/something/file.xyz
dest/something/otherfile.xyz
How do I express that dependency in a Makefile, so that updating the prerequisite file causes a recipe to recreate the target?
The GNU Make manual says "Wildcard expansion is performed by make
automatically in targets and in prerequisites". Going by that, I would expect
dest/*/%.xyz : src/foo/%.abc
install -d $< $@
to work, but it fails:
$ make -f test.mk dest/bar/file.xyz
make: *** No rule to make target `dest/bar/file.xyz'. Stop.
Am I misunderstanding wildcard expansion in targets? Is there some better way to achieve what I'm after?
Environment: GNU Make 3.82.90
32-bit Cygwin