When curly brace paths are used on target/dependency statements, the location of existing target/dependency files determines the inference rule to be used. This is demonstrated in the following example:

Example:

{p1}.c{p4}.obj:
   icc -fo$@ -c $<

{p3}.c{p4}.obj:
   icc -fo$@ -c $<

{p3}.c{p4}.obj:
   icc -fo$@ -c $<

{p2;p4} file.obj : {p1;p3} file.c

If file.obj exists in the p4 directory and file.c exists in the p1 directory, the first inference rule will be used if the target needs updating. Note that if file.obj also was on disk in the p2 directory, the first directory found during explicit target path matching would be p2. There is not an inference rule defined for the {p1}.c{p2}.obj combination, so inference rule processing would fail.


[Back] [Next]