help-make
[Top][All Lists]
Advanced

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

help with $(filter ) in pattern rule prereq


From: Asperheim, Eric
Subject: help with $(filter ) in pattern rule prereq
Date: Thu, 21 Mar 2002 14:12:39 -0800

All,

I'm trying to use the $(filter ) function in the prereq portion of a pattern
rule. Unfortunately, I can't get this to work due to the handling of the "%"
character. I'm using gmake version 3.79.1 on HPUX platform. 

For example,

Makefile
--------------------------
rprereqs := ../../c/v80/dbs/c_1.db ../../a/v80/dbs/a.db ../../b/v80/dbs/b.db


# $(filter %, $(rprereqs))
%.db : $(filter %.db, $(rprereqs))
        @ echo "target -> $@"
        @ echo "prereq -> $^"

../../%.db : 
        @ echo "target -> $@"
        @ echo "prereq -> $^"

--------------------------

gmake b.db
target -> b.db
prereq -> 
fhc2349:easperhe gmake b.db
target -> ../../c/v80/dbs/c_1.db
prereq -> 
target -> ../../a/v80/dbs/a.db
prereq -> 
target -> ../../b/v80/dbs/b.db
prereq -> 
target -> b.db
prereq -> ../../c/v80/dbs/c_1.db ../../a/v80/dbs/a.db ../../b/v80/dbs/b.db


I want the % character in the $(filter ) function to resolve to "b" so that
the I'll get

target -> b.db
prereq -> ../../b/v80/dbs/b.db

But it doesn't. Is there anyway to get the $(filter ) command to do what I
want. Or, another way to get this to work?

Thanks,

Eric

Eric Asperheim  -  CSE Design Automation
phone: (916) 356-4624 
Intel Corporation, FM6-81
fax: (916) 356-3051 
1900 Prairie City Rd, Folsom, CA 95630
address@hidden
----------------------------------------------------------------------------
--------------------------------- 





reply via email to

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