Hello,

I have an implicit rule like this which is intended to be used in a directory 
"dir1" - in this example it just copies stuff over from another directory "dir0"

.SECONDEXPANSION:
foo%: $$(subst dir1,dir0,$$(abspath $$@))
        cp $< $@


This is a problem - by the algorithm of pattern rule matching, this rule target 
will also match its prerequisite (the absolute path) and there it will be a 
circular dependency.

I could put "::" here to prevent chaining, but then I have a different problem, 
by the algorithm, that "::" rule would take precedence over another one for a 
"partial path", like dir/foo%

------------------

Basically all I want really is to have two rules like:

foo%: ...
        ...

dir/foo%: ...
        ...

the first should match stuff in current directory only, the second, in a 
subdirectory "dir".  It seems difficult to accomplish, because the pattern 
matching algorithm does not just match patterns, but also splits into directory 
and file part and matches the file part separately.

Why is this so difficult? Am I missing something here? How do you get two such 
rules coexist?

Mark

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to