According to Gnu Make Manual and GNU Makefile - Pattern rule with multiple targets with one dependency ignores all targets but the first, pattern rule with multiple targets behaves different from normal rule. Latter is equivalent to multiple rules each with only one target.
Because I am designing a tool like make, I want to know the rationale behind this different behavior, why wouldn't both kinds of rules use the same logic?
EDIT:
For example, I have a Makefile:
%.md %.ps: %.tex
echo "rule 1"
doc1.tar.gz: doc1.md doc1.ps
echo "rule 2"
doc2.md doc2.ps: doc2.tex
echo "rule 3"
doc2.tar.gz: doc2.md doc2.ps
echo "rule 4"
make doc1.tar.gz
gives me:
echo "rule 1"
rule 1
echo "rule 2"
rule 2
but doc2.tar.gz
gives me:
echo "rule 3"
rule 3
echo "rule 3"
rule 3
echo "rule 4"
rule 4
My question is: Why rule 1 could not runs twice just like rule 3? What will be the problem if such pattern rule runs more than once?