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

Newsgroups gnu.utils.help
Date 2020-03-09 03:14 -0700
References <90cc01ee.0205121052.5a8c161e@posting.google.com>
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>

Show all headers | 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