Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.utils.help > #318

Re: gmake and filter inside an implicit rule

X-Received by 2002:a05:620a:84d:: with SMTP id u13mr14371818qku.94.1583748892743; Mon, 09 Mar 2020 03:14:52 -0700 (PDT)
X-Received by 2002:aca:5546:: with SMTP id j67mr2561205oib.0.1583748892300; Mon, 09 Mar 2020 03:14:52 -0700 (PDT)
Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups gnu.utils.help
Date Mon, 9 Mar 2020 03:14:52 -0700 (PDT)
In-Reply-To <90cc01ee.0205121052.5a8c161e@posting.google.com>
Complaints-To groups-abuse@google.com
Injection-Info google-groups.googlegroups.com; posting-host=165.225.76.136; posting-account=jCb00AoAAABHyPdOpwsjqMUv-BpmtgI4
NNTP-Posting-Host 165.225.76.136
References <90cc01ee.0205121052.5a8c161e@posting.google.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <6cbe192a-c6df-41be-a167-23357ea0df2e@googlegroups.com> (permalink)
Subject Re: gmake and filter inside an implicit rule
From igx31 <jean.marc.challier@gmail.com>
Injection-Date Mon, 09 Mar 2020 10:14:52 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 30
Xref csiph.com gnu.utils.help:318

Show key headers only | View raw


Le dimanche 12 mai 2002 20:52:19 UTC+2, Riccardo de Maria a écrit :
> I've problems using filter function to find prerequisites.
> [...]

Hello,

We've been having the same issue in one of our projects, and had to resort to using Secondary Expansion for that - cf. https://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html

More precisely, we had to build several libraries, named lib/libxxxx.a, from sources named src/xxxx_*.c. This is the rule we have written :

.SECONDEXPANSION:

$(LIB_DIR)/$(LIB_PRE)%$(LIB_SUF): $$(filter $(OBJ_DIR)/%_$\%$(OBJ_SUF), $(OBJ))
	$(AR) $(ARFLAGS) $@ $^

In your case, I'm pretty sure it would look something like that (without using your own variables, but it will probably be easy to translate) :

EPS_FILES=$(wildcard cap*.eps)

.SECONDEXPANSION:

cap%.dvi: cap%.tex $$(filter cap%-$\%.eps, $(EPS_FILES))
        @echo Building $@ from $^

Hope this helps,

Back to gnu.utils.help | Previous | Next | Find similar


Thread

Re: gmake and filter inside an implicit rule igx31 <jean.marc.challier@gmail.com> - 2020-03-09 03:14 -0700

csiph-web