bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #62206] Fix % substitution in pattern rules.


From: Dmitry Goncharov
Subject: [bug #62206] Fix % substitution in pattern rules.
Date: Mon, 21 Mar 2022 11:16:26 -0400 (EDT)

Follow-up Comment #3, bug #62206 (project make):

> What I usually do is recommend people use $$* instead of % in secondary
expansion expressions like this as it's more clear and less confusing, and
ends up being the same result.

There are situations where the difference between % and $$* matters.

For example, let us say there are files 3hello.c and lib/3hello.c and the
following makefile.


++++
.SECONDEXPANSION:
all: lib/hello.o hello.o
%.o: 3%.c; $(info $@ from $<)
----


This makefile allows to build both hello.o from 3hello.c and lib/hello.o from
lib/3hello.c with a single rule.

It is possible to workaround this as well by using two rules lib/%.o: and
%.o:. So, i was thinking maybe fixing this is not worth the effort. On the
other hand, lots of users may not be familiar with make enough to figure this
out. With this patch it just works.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62206>

_______________________________________________
  Сообщение отправлено по Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]