If I run the following makefile under GNU Make 3.81 / RHEL5:
all: A1B/C A1B/D A2B/C A2B/D
A%B/C A%B/D: E.%
@echo "Creating '$@' from '$^' with stem '$*'"
E.1 E.2:
@echo "Generate '$@'"
I get the following output:
Generate 'E.1'
Creating 'A1B/C' from 'E.1' with stem '1'
Generate 'E.2'
Creating 'A2B/C' from 'E.2' with stem '2'
Why are files A1B/D and A2B/D not generated? (files with such names do not exist in my testcase)
If I specify the targets via the command line make states "Nothing to be done":
make A1B/C A1B/D A2B/C A2B/D
Generate 'E.1'
Creating 'A1B/C' from 'E.1' with stem '1'
make: Nothing to be done for `A1B/D'.
Generate 'E.2'
Creating 'A2B/C' from 'E.2' with stem '2'
make: Nothing to be done for `A2B/D'.
If I duplicate the implicit rule into their targets it works:
all: A1B/C A1B/D A2B/C A2B/D
A%B/C: E.%
@echo "Creating '$@' from '$^' with stem '$*'"
A%B/D: E.%
@echo "Creating '$@' from '$^' with stem '$*'"
E.1 E.2:
@echo "Generate '$@'"
Generate 'E.1'
Creating 'A1B/C' from 'E.1' with stem '1'
Creating 'A1B/D' from 'E.1' with stem '1'
Generate 'E.2'
Creating 'A2B/C' from 'E.2' with stem '2'
Creating 'A2B/D' from 'E.2' with stem '2'
According to the documentation this should not make a difference.
Thanks in advance.
Michael