help-make
[Top][All Lists]
Advanced

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

Re: some simple help


From: Paul Smith
Subject: Re: some simple help
Date: Wed, 16 Apr 2008 19:51:56 -0400

On Wed, 2008-04-16 at 18:29 -0500, Billy N. Patton wrote:
> so next I have
> 
> all : ${FILES}
> 
> I need to do 2 strings from each one of the files name to create a
> rule
> 
> /data/phy_ver10/regressionData/c014/C014.M/REGRESSION/RULE_1A_PASS/layout/layout.cdb
>  : 
> /data/phy_ver10/DROP_ZONE/c014/C014.M/drc/RULE_1A_PASS.gds
> 
> where RULE_1A_PASS is one of the 5k+ elements of ${FILES}
> 
> I know I can build each string
> 
> ${addprefix ${CADENCEDB}/,${addsuffix /layout/layout.cdb,${FILES}}}
> ${addprefix ${DROP_ZONE}/,${addsuffix .gds,${FILES}}
> 
> These should build all the strings
> 
> But how do I go from
> all : ${FILES}
> to
> ${addprefix ${CADENCEDB}/,${addsuffix /layout/layout.cdb,${FILES}}} :
> ${addprefix ${DROP_ZONE}/,${addsuffix .gds,${FILES}}

OK.  First, your "all : ${FILES}" target is not correct.

The all target should depend on the files you want to create.  You don't
want to create RULE_1A_PASS, you want to
create 
/data/phy_ver10/regressionData/c014/C014.M/REGRESSION/RULE_1A_PASS/layout/layout.cdb.
  So, the all target should depend on THAT, not RULE_1A_PASS.

Remember make "works backwards"; it starts with what you want to
eventually have created, then looks through the rules in the makefile to
figure out how to get there.

So, again based on your description above I would do it like this:

        FILES := $(patsubst $(CADENCEDB)/%/layout/layout.cdb,$(notdir 
$(wildcard $(CADENCEDB)/RULE_*)))
        
        all: $(FILES)
        
        $(CADENCEDB)/%/layout/layout.cdb : $(DROP_ZONE)/%.gds
                < recipe to build $@ from $< >

and you're done.  Read up on pattern rules in the GNU make manual to
understand the last item.

-- 
-----------------------------------------------------------------------------
 Paul D. Smith <address@hidden>                 http://make.mad-scientist.us
 "Please remain calm--I may be mad, but I am a professional."--Mad Scientist






reply via email to

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