help-make
[Top][All Lists]
Advanced

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

Re: How to write rules for dependencies together with include?


From: Paul Smith
Subject: Re: How to write rules for dependencies together with include?
Date: Sun, 18 Jan 2009 10:05:45 -0500

On Sun, 2009-01-18 at 13:20 +0100, Georg-Johann Lay wrote:
> In a make process I have to get verbatim copies (VPATH and vpath will 
> not work) from files in, say, $(FILES), which are located in $(DIR).
> 
> DIR is one directory and FILES is a list of plain file names with no 
> path prefixes.
> 
> So the rules to get the files should look like this:
> 
> foo1.a: $(DIR)/foo1.a
>       cp $^ .
> 
> foo2.b: $(DIR)/foo2.b
>       cp $^ .

Can you just use static pattern rules?

$(FILES): % : $(DIR)/%
        cp $< $@

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      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]