I have the following simplified Makefile:
foo-%: dep-%
@echo in foo $*
bar-%: dep-%
dep-%:
@echo in dep $*
make dep-aa works. What is interesting is that while make foo-aa works, make bar-aa does not, even though it has the same dependency on dep-%. Why is that? And how do you work around it?
$ make dep-aa
in dep aa
$ make foo-aa
in dep aa
in foo aa
$ make bar-aa
make: *** No rule to make target `bar-aa'. Stop.
Obviously the simple case above does not add much, but if I have multiple sub-targets, it would be useful, e.g.
foo-%: abc-% def-% xyz-%
I figure I can do this somehow with static targets, not sure, but I would like to understand why the above does not work.
Thanks in advance
>Solution :
The documentation is pretty clear:
You can cancel a built-in implicit rule by defining a pattern rule with the same target and prerequisites, but no recipe. For example, the following would cancel the rule that runs the assembler:
%.o : %.s