bug-make
[Top][All Lists]
Advanced

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

[bug #62162] patsubst not working in prerequisites under .SECONDEXPANSIO


From: Mikhail
Subject: [bug #62162] patsubst not working in prerequisites under .SECONDEXPANSION
Date: Thu, 10 Mar 2022 22:22:07 -0500 (EST)

Follow-up Comment #4, bug #62162 (project make):

Thanks, _$$(percent)_ trick makes the job done. 

However what is happening is still obscure. For example, here _patsubst_ does
everything correctly


lib1_SRCS := main.c try.c test.c
lib2_SRCS := lib.c api.c

.SECONDEXPANSION:
lib1 lib2: $$(patsubst %.c,%.o,$$($$@_SRCS))


and _lib1_  depends on main.o, try.o and test.o.

Reworking it in static pattern rule fashion results in prerequisites main.c,
try.c and test.c for _lib1_, i.e. patsubst does nothing.


lib1_SRCS := main.c try.c test.c
lib2_SRCS := lib.c api.c

.SECONDEXPANSION:
lib1 lib2: lib% : $$(patsubst %.c,%.o,$$(lib$$*_SRCS))


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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