On Wed, 2023-09-27 at 16:50 +0200, Renaud Pacalet wrote:
> %.a: %.b
>
> a.a: a.c
> echo $^
>
> I would not say that the pattern rule and the explicit rule are
> equivalent because they have different prerequisite lists, the former
> has no recipe, the latter has one. Yet, running 'touch a.c a.b; make -s
> a.a' prints only 'a.c', which shows that the pattern rule is ignored.
To my mind, it makes sense b/c `a.a' is more specific than `%.a' and as
such the prerequisites declared by the pattern rule do not apply.
To add a little twist here, the following snippet produces `foo a.c' 🙂
🙶
%.a : X = foo
%.a: %.b
a.a: a.c
@echo $(X) $(^)
🙸
--
Bahman
Join the chatter on Matrix:
🌐 https://matrix.to/#/#.mk:matrix.org
Subscribe to the Lemmy community:
🌐 https://lemmy.ml/c/makefile