On Thursday, September 11, 2025, Alejandro Colomar <a...@kernel.org> wrote:
> Hi Paul, > > On Thu, Sep 11, 2025 at 08:59:42AM -0400, Paul Smith wrote: > > On Wed, 2025-09-10 at 23:38 +0200, Alejandro Colomar wrote: > > > The reason I want to be able to undefine the variable name is to not > > > need to come up with unique names in variables used within a recipe. > > > That's why I immediately undefine it; to be able to reuse the name, > > > making sure that old values are not used accidentally. > > > > There are lots and lots of ways to do that. You didn't really explain > > clearly the problem you're trying to solve > > Okay, what I'm trying to solve is: > > I have many rules in which I use grep(1), and I have different regex > files for each of the rules (for use with 'grep -f'). The regex files > are both a prerequisite (if I change the regex file I want to re-make > the targets), and part of the recipe (I need to pass the file name to > grep(1)). Hmm, if the regexp file names match a consistent, unambiguous pattern (like, all have the suffix “.ref”) then the command in the recipe could match that from the prerequisite list with $(filter %.ref, $^) so that the filename only appears as a literal in the prerequisite list. Philip Guenther